Skip to content

Commit

Permalink
Merge branch 'master' into 6.x
Browse files Browse the repository at this point in the history
* master:
  [AdminBundle] Fix symfony/security-acl 3.2 test errors
  [AdminBundle] Fix remaining usages of deprecated admin_exception_excludes config
  [NodeSearchBundle] Add missing deprecation for change in searcher lookup
  [AdminBundle] Fix redirect loop with setup without new authentication setup
  [AllBundles] Bump gedmo/doctrine-extensions to prepare for php8 support
  [AllBundle] Replace abanoned faker package
  [AllBundles] Backport phpstan 0.12.92 fixes
  [AllBundles] Fix branch alias of separate packages
  [AllBundles] Fix doctrine common deprecations and resolve doctrine bundle v2 incompatibility
  [AllBundles] Fix phpstan errors for checks added in 0.12.92
  Update sortablejs back to 1.8.1
  Increase max length for translation domain
  Dont render empty og:title
  Use oembed url for vimeo thumbnail
  • Loading branch information
acrobat committed Jul 25, 2021
2 parents 3a0f940 + 59e187d commit 5c8d308
Show file tree
Hide file tree
Showing 79 changed files with 292 additions and 106 deletions.
2 changes: 2 additions & 0 deletions UPGRADE-5.9.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ General
instead of `white-october/pagerfanta-bundle`. All specific bundle packages that use pagerfanta functionality are now requiring
the specifc pagerfanta packages. Newer skeleton installs will require the correct pagerfanta bundle package but old projects
or projects using the `white-october` package are encouraged to switch their dependencies.
* The abandoned package `fzaninotto/faker` is replaced with the `fakerphp/faker` package. If you use the abandoned package
in your project, replace it with `fakerphp/faker` to allow upgrading to v5.9.

AdminBundle
------------
Expand Down
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"doctrine/inflector": "^1.4|^2.0",
"doctrine/orm": "^2.5",
"doctrine/dbal": "^2.9",
"doctrine/doctrine-bundle": "^1.6.12|^2.0",
"doctrine/doctrine-bundle": "^1.12.3|^2.0.3",
"doctrine/doctrine-cache-bundle": "^1.2",
"doctrine/doctrine-migrations-bundle": "^1.3|^2.1",
"symfony/swiftmailer-bundle": "^2.3|^3.0",
Expand All @@ -63,7 +63,7 @@
"guzzlehttp/guzzle": "~6.1",
"babdev/pagerfanta-bundle": "^2.5",
"kunstmaan/google-api-custom": "~1.0",
"gedmo/doctrine-extensions": "^2.4.34",
"gedmo/doctrine-extensions": "^2.4.34|^3.1.0",
"doctrine/doctrine-fixtures-bundle": "^3.3",
"stof/doctrine-extensions-bundle": "^1.3",
"liip/imagine-bundle": "^2.4",
Expand All @@ -83,9 +83,8 @@
},
"require-dev": {
"symfony/debug": "^3.4.21|^4.4",
"fzaninotto/faker": "~1.6",
"fakerphp/faker": "^1.15",
"ekino/newrelic-bundle": "^1.4",
"nelmio/alice": "^3.5",
"matthiasnoback/symfony-config-test": "^4.0",
"matthiasnoback/symfony-dependency-injection-test": "^4.1",
"symfony/phpunit-bridge": "^5.2",
Expand Down Expand Up @@ -124,7 +123,8 @@
"kunstmaan/voting-bundle": "self.version"
},
"conflict": {
"friendsofsymfony/user-bundle": "<2.0.0"
"friendsofsymfony/user-bundle": "<2.0.0",
"doctrine/persistence": "<1.3"
},
"autoload": {
"psr-4": {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
"picturefill": "^3.0.2",
"plupload": "^2.3.6",
"select2": "^4.0.3",
"sortablejs": "1.5.1",
"sortablejs": "^1.8.1",
"velocity-animate": "^1.5.2",
"x-editable": "^1.5.1"
}
Expand Down
9 changes: 9 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,18 @@ parameters:
# Excluded deprecated classes/files
- src/Kunstmaan/AdminBundle/Composer/ScriptHandler.php
- src/Kunstmaan/AdminBundle/EventListener/ConsoleExceptionListener.php
- src/Kunstmaan/GeneratorBundle/Helper/Sf4AppBundle.php # BC layer
- src/Kunstmaan/TranslatorBundle/Command/MigrationsDiffCommand.php
- src/Kunstmaan/TranslatorBundle/Service/Command/DiffCommand.php
- src/Kunstmaan/*/Event/*.php # Ignore the event classes until we get rid of the BC layer. The BC layer causes a weird phpstan error.
- src/Kunstmaan/GeneratorBundle/Helper/Sf4AppBundle.php # BC layer

ignoreErrors:
- '#Constructor of class Kunstmaan\\MediaBundle\\AdminList\\MediaAdminListConfigurator has an unused parameter \$mediaManager\.#' # Will be fixed in separate PR

# Incorrect return types. Needs to be deprecated and removed in separate PR's
- '#Method Kunstmaan\\AdminBundle\\Form\\UserType\:\:setCanEditAllFields\(\) should return bool but return statement is missing\.#'
- '#Method Kunstmaan\\TranslatorBundle\\Service\\Command\\Exporter\\ExportCommandHandler\:\:executeExportCommand\(\) should return int but return statement is missing\.#'
- '#Method Kunstmaan\\NodeSearchBundle\\PagerFanta\\Adapter\\SearcherRequestAdapter\:\:processResponse\(\) should return array\|Elastica\\ResultSet but return statement is missing\.#'
- '#Method Kunstmaan\\NodeSearchBundle\\Configuration\\NodePagesConfiguration\:\:(addPermissions|addSearchType)\(\) should return array but return statement is missing\.#'
- '#Method Kunstmaan\\DashboardBundle\\Repository\\AnalyticsSegmentRepository\:\:deleteSegment\(\) should return bool\|Kunstmaan\\DashboardBundle\\Entity\\AnalyticsOverview but return statement is missing\.#'
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ public function load(array $configs, ContainerBuilder $container)

$container->setParameter('kunstmaan_admin.admin_prefix', $this->normalizeUrlSlice($config['admin_prefix']));

$container->setParameter('kunstmaan_admin.admin_exception_excludes', $config['admin_exception_excludes']);
$exceptionExcludes = !empty($config['exception_logging']['exclude_patterns']) ? $config['exception_logging']['exclude_patterns'] : $config['admin_exception_excludes'];
$container->setParameter('kunstmaan_admin.admin_exception_excludes', $exceptionExcludes);

$container->setParameter('kunstmaan_admin.google_signin.enabled', $config['google_signin']['enabled']);
$container->setParameter('kunstmaan_admin.google_signin.client_id', $config['google_signin']['client_id']);
Expand Down
8 changes: 8 additions & 0 deletions src/Kunstmaan/AdminBundle/Entity/BaseUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,8 @@ public function setUsernameCanonical($usernameCanonical)
@trigger_error(sprintf('Using method %s from class %s is deprecated since KunstmaanAdminBundle 5.9 and will be removed in KunstmaanAdminBundle 6.0.', __METHOD__, BaseUser::class), E_USER_DEPRECATED);

$this->usernameCanonical = $usernameCanonical;

return $this;
}

/**
Expand All @@ -526,6 +528,8 @@ public function setEmailCanonical($emailCanonical)
@trigger_error(sprintf('Using method %s from class %s is deprecated since KunstmaanAdminBundle 5.9 and will be removed in KunstmaanAdminBundle 6.0.', __METHOD__, BaseUser::class), E_USER_DEPRECATED);

$this->emailCanonical = $emailCanonical;

return $this;
}

/**
Expand Down Expand Up @@ -562,13 +566,17 @@ public function getConfirmationToken()
public function setConfirmationToken($confirmationToken)
{
$this->confirmationToken = $confirmationToken;

return $this;
}

public function setPasswordRequestedAt(DateTime $date = null)
{
//TODO: check if this propery is usefull?
// NEXT_MAJOR remove method
@trigger_error(sprintf('Using method %s from class %s is deprecated since KunstmaanAdminBundle 5.9 and will be removed in KunstmaanAdminBundle 6.0.', __METHOD__, BaseUser::class), E_USER_DEPRECATED);

return $this;
}

public function getLastLogin()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public function onKernelRequest($event)
}

$route = $event->getRequest()->get('_route');
if (null === $route || $route === 'kunstmaan_admin_forced_change_password') {
if (null === $route || in_array($route, ['kunstmaan_admin_forced_change_password', 'fos_user_change_password'], true)) {
return;
}

Expand Down
4 changes: 2 additions & 2 deletions src/Kunstmaan/AdminBundle/Service/GroupManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace Kunstmaan\AdminBundle\Service;

use Doctrine\Common\Persistence\ObjectRepository;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\EntityRepository;
use Kunstmaan\AdminBundle\Entity\GroupInterface;

class GroupManager
Expand All @@ -12,7 +12,7 @@ class GroupManager
private $em;
/** @var string */
private $class;
/** @var ObjectRepository */
/** @var EntityRepository */
private $repository;

public function __construct(EntityManagerInterface $em, string $class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,51 @@ public function testLegacyParameters()
$this->assertContainerBuilderHasParameter('kunstmaan_admin.default_locale', '');
}

/**
* @group legacy
*/
public function testDeprecatedExceptionExcludes()
{
$this->load(array_merge($this->getRequiredConfig(), [
'authentication' => [
'enable_new_authentication' => true,
],
'admin_exception_excludes' => [
'test_exclude',
],
]));

$this->assertContainerBuilderHasParameter('kunstmaan_admin.admin_exception_excludes', ['test_exclude']);
}

/**
* @group legacy
*/
public function testDeprecatedExceptionExcludesWithNewConfig()
{
$this->load(array_merge($this->getRequiredConfig(), [
'admin_exception_excludes' => [
'test_exclude',
],
'exception_logging' => [
'exclude_patterns' => ['test_exclude_new_config'],
],
]));

$this->assertContainerBuilderHasParameter('kunstmaan_admin.admin_exception_excludes', ['test_exclude_new_config']);
}

public function testExceptionExcludesFromExceptionLoggingConfig()
{
$this->load(array_merge($this->getRequiredConfig(), [
'exception_logging' => [
'exclude_patterns' => ['test_exclude_new_config'],
],
]));

$this->assertContainerBuilderHasParameter('kunstmaan_admin.admin_exception_excludes', ['test_exclude_new_config']);
}

protected function setUp(): void
{
parent::setUp();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public function testInitByExample()
$mutableAcl = $this->createMock(MutableAclInterface::class);

$entry->expects($this->once())->method('getSecurityIdentity')->willReturn($security);
$entry->expects($this->once())->method('getMask')->willReturn(1);
$mutableAcl->expects($this->once())->method('getObjectAces')->willReturn([$entry]);
$strategy->expects($this->exactly(2))->method('getObjectIdentity')->willReturn($user);
$provider->expects($this->once())->method('findAcl')->willReturn($mutableAcl);
Expand All @@ -48,6 +49,6 @@ public function testInitByMap()
$provider->expects($this->once())->method('deleteAcl')->willThrowException(new AclNotFoundException());

$aclCreator = new ACLPermissionCreator($provider, $strategy);
$aclCreator->initByMap($user, ['key' => 'value'], true);
$aclCreator->initByMap($user, ['ROLE' => 1], true);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public function testWalker()
{
$range = new RangeVariableDeclaration('someschema', 's');
$expr = new PathExpression('int', 'id');
$expr->type = PathExpression::TYPE_STATE_FIELD;
$indexBy = new IndexBy($expr);
$from = new FromClause([new IdentificationVariableDeclaration($range, $indexBy, [])]);

Expand Down
4 changes: 2 additions & 2 deletions src/Kunstmaan/AdminBundle/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"babdev/pagerfanta-bundle": "^2.5",
"doctrine/orm": "^2.5",
"doctrine/dbal": "^2.5",
"doctrine/doctrine-bundle": "^1.6.12|^2.0",
"doctrine/doctrine-bundle": "^1.12.3|^2.0.3",
"doctrine/doctrine-cache-bundle": "^1.2",
"friendsofsymfony/user-bundle": "^2.0",
"guzzlehttp/guzzle": "~6.1",
Expand Down Expand Up @@ -78,7 +78,7 @@
},
"extra": {
"branch-alias": {
"dev-master": "5.8-dev"
"dev-master": "5.9-dev"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ abstract class AdminListController extends Controller
/**
* You can override this method to return the correct entity manager when using multiple databases ...
*
* @return \Doctrine\Common\Persistence\ObjectManager|object
* @return \Doctrine\Persistence\ObjectManager|object
*/
protected function getEntityManager()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Kunstmaan\AdminListBundle\Controller;

use Kunstmaan\AdminListBundle\Entity\LockableEntityInterface;
use Kunstmaan\AdminListBundle\Service\EntityVersionLockService;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\JsonResponse;
Expand All @@ -14,7 +15,7 @@ class EntityLockCheckController extends Controller
/**
* You can override this method to return the correct entity manager when using multiple databases ...
*
* @return \Doctrine\Common\Persistence\ObjectManager|object
* @return \Doctrine\Persistence\ObjectManager|object
*/
protected function getEntityManager()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Kunstmaan\AdminListBundle\Service;

use Doctrine\Common\Persistence\ObjectManager;
use Doctrine\Persistence\ObjectManager;
use FOS\UserBundle\Model\User;
use Kunstmaan\AdminBundle\Entity\UserInterface;
use Kunstmaan\AdminListBundle\Entity\EntityVersionLock;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ protected function setUp(): void
[EntityVersionLock::class, $mockLockRepository],
[LockableEntity::class, $mockLockableRepository],
];
$mockObjectManager = $this->getMockBuilder('Doctrine\Common\Persistence\ObjectManager')
$mockObjectManager = $this->getMockBuilder('Doctrine\Persistence\ObjectManager')
->disableOriginalConstructor()
->getMock();
$mockObjectManager
Expand Down
5 changes: 4 additions & 1 deletion src/Kunstmaan/AdminListBundle/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,16 @@
"kunstmaan/menu-bundle": "^5.2",
"kunstmaan/translator-bundle": "^5.2"
},
"conflict": {
"doctrine/persistence": "<1.3"
},
"minimum-stability": "dev",
"autoload": {
"psr-4": { "Kunstmaan\\AdminListBundle\\": "" }
},
"extra": {
"branch-alias": {
"dev-master": "5.8-dev"
"dev-master": "5.9-dev"
}
}
}
2 changes: 1 addition & 1 deletion src/Kunstmaan/ArticleBundle/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"minimum-stability": "dev",
"extra": {
"branch-alias": {
"dev-master": "5.8-dev"
"dev-master": "5.9-dev"
}
}
}
2 changes: 1 addition & 1 deletion src/Kunstmaan/BehatBundle/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"minimum-stability": "dev",
"extra": {
"branch-alias": {
"dev-master": "5.8-dev"
"dev-master": "5.9-dev"
}
}
}
2 changes: 1 addition & 1 deletion src/Kunstmaan/CacheBundle/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
},
"extra": {
"branch-alias": {
"dev-master": "5.8-dev"
"dev-master": "5.9-dev"
}
}
}
2 changes: 1 addition & 1 deletion src/Kunstmaan/ConfigBundle/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
},
"extra": {
"branch-alias": {
"dev-master": "5.8-dev"
"dev-master": "5.9-dev"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,9 @@ protected function execute(InputInterface $input, OutputInterface $output)
*
* @param int $segmentId
*
* @return array
*
* @throws \InvalidArgumentException
*/
private function generateOverviewsOfSegment($segmentId)
private function generateOverviewsOfSegment($segmentId): void
{
/** @var AnalyticsSegmentRepository $segmentRepository */
$segmentRepository = $this->em->getRepository(AnalyticsSegment::class);
Expand All @@ -126,11 +124,9 @@ private function generateOverviewsOfSegment($segmentId)
*
* @param int $configId
*
* @return array
*
* @throws \InvalidArgumentException
*/
private function generateOverviewsOfConfig($configId)
private function generateOverviewsOfConfig($configId): void
{
$configRepository = $this->em->getRepository(AnalyticsConfig::class);
$segmentRepository = $this->em->getRepository(AnalyticsSegment::class);
Expand All @@ -156,10 +152,8 @@ private function generateOverviewsOfConfig($configId)

/**
* get all overviews
*
* @return array
*/
private function generateAllOverviews()
private function generateAllOverviews(): void
{
$configRepository = $this->em->getRepository(AnalyticsConfig::class);
$overviewRepository = $this->em->getRepository(AnalyticsOverview::class);
Expand Down
2 changes: 1 addition & 1 deletion src/Kunstmaan/DashboardBundle/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
},
"extra": {
"branch-alias": {
"dev-master": "5.8-dev"
"dev-master": "5.9-dev"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace Kunstmaan\FixturesBundle\Builder;

use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Persistence\ObjectManager;
use Doctrine\Persistence\ObjectManager;
use Kunstmaan\FixturesBundle\Loader\Fixture;
use Kunstmaan\FixturesBundle\Parser\Parser;
use Kunstmaan\FixturesBundle\Populator\Populator;
Expand Down
Loading

0 comments on commit 5c8d308

Please sign in to comment.