From 1a3a872b5bfbe6ee65b12d16281689a69d55d685 Mon Sep 17 00:00:00 2001 From: Jeroen Thora Date: Sun, 24 Oct 2021 18:59:02 +0200 Subject: [PATCH] [AllBundles] Fixed undefined class warnings in typehints --- .../AdminBundle/Command/ApplyAclCommand.php | 2 +- .../FormWidgets/FormWidgetInterface.php | 1 + .../Acl/Permission/PermissionAdmin.php | 1 + .../Helper/Security/OAuth/OAuthUserFinder.php | 2 +- .../AdminBundle/Service/AclManager.php | 6 +-- .../DependencyInjection/Configuration.php | 1 + .../FilterType/ORM/BooleanFilterTypeTest.php | 6 --- .../FilterType/ORM/DateFilterTypeTest.php | 6 --- .../AbstractAnalyticsCommandHelper.php | 4 +- .../Entity/AnalyticsConfig.php | 6 +-- .../Entity/AnalyticsOverview.php | 4 +- .../Entity/AnalyticsSegment.php | 2 +- .../Helper/Google/Analytics/ConfigHelper.php | 1 + .../Helper/Google/Analytics/ServiceHelper.php | 2 +- .../Controller/FormSubmissionsController.php | 1 + .../ConfigureActionsMenuListener.php | 1 + .../GenerateDefaultPagePartsCommand.php | 1 + .../Command/GenerateDefaultSiteCommand.php | 1 + .../Command/GenerateFormPagePartsCommand.php | 1 + .../Command/GenerateLayoutCommand.php | 1 + .../Command/GeneratePagePartCommand.php | 1 + .../Entity/Rule/AbstractRule.php | 2 +- .../Entity/Rule/AfterXScrollPercentRule.php | 2 +- .../Command/RenameSoftDeletedCommand.php | 3 +- .../Entity/QueuedNodeTranslationAction.php | 2 +- .../FormWidgets/PermissionsFormWidget.php | 8 +-- src/Kunstmaan/NodeBundle/Helper/NodeMenu.php | 1 + .../Tests/Helper/NodeHelperTest.php | 15 +++--- .../Tests/EventListener/CloneListenerTest.php | 8 +-- .../Extension/PagePartAdminTwigExtension.php | 5 +- src/Kunstmaan/TaggingBundle/Entity/Tag.php | 2 +- .../TaggingBundle/Entity/Tagging.php | 4 +- .../Form/DataTransformer/TagsTransformer.php | 51 +------------------ .../TranslationAdminListConfigurator.php | 1 + .../DataFixtures/ORM/TranslationFixtures.php | 3 +- .../Model/Translation/TranslationGroup.php | 5 +- .../Service/TranslationGroupManager.php | 6 +-- .../Service/Translator/ResourceCacher.php | 5 +- .../Service/Translator/Translator.php | 2 +- .../Services/RepositoryResolver.php | 8 +-- 40 files changed, 74 insertions(+), 110 deletions(-) diff --git a/src/Kunstmaan/AdminBundle/Command/ApplyAclCommand.php b/src/Kunstmaan/AdminBundle/Command/ApplyAclCommand.php index 655abe9eb9..ee9a31186f 100644 --- a/src/Kunstmaan/AdminBundle/Command/ApplyAclCommand.php +++ b/src/Kunstmaan/AdminBundle/Command/ApplyAclCommand.php @@ -19,7 +19,7 @@ class ApplyAclCommand extends ContainerAwareCommand { /** - * @var EntityManager + * @var EntityManagerInterface */ private $em = null; diff --git a/src/Kunstmaan/AdminBundle/Helper/FormWidgets/FormWidgetInterface.php b/src/Kunstmaan/AdminBundle/Helper/FormWidgets/FormWidgetInterface.php index d7e05b0d2f..d926654e4f 100644 --- a/src/Kunstmaan/AdminBundle/Helper/FormWidgets/FormWidgetInterface.php +++ b/src/Kunstmaan/AdminBundle/Helper/FormWidgets/FormWidgetInterface.php @@ -3,6 +3,7 @@ namespace Kunstmaan\AdminBundle\Helper\FormWidgets; use Doctrine\ORM\EntityManager; +use Kunstmaan\AdminBundle\Helper\FormWidgets\Tabs\TabInterface; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Form\FormView; use Symfony\Component\HttpFoundation\Request; diff --git a/src/Kunstmaan/AdminBundle/Helper/Security/Acl/Permission/PermissionAdmin.php b/src/Kunstmaan/AdminBundle/Helper/Security/Acl/Permission/PermissionAdmin.php index 92ba3706ce..7168f12f5d 100644 --- a/src/Kunstmaan/AdminBundle/Helper/Security/Acl/Permission/PermissionAdmin.php +++ b/src/Kunstmaan/AdminBundle/Helper/Security/Acl/Permission/PermissionAdmin.php @@ -5,6 +5,7 @@ use Doctrine\ORM\EntityManager; use Kunstmaan\AdminBundle\Entity\AbstractEntity; use Kunstmaan\AdminBundle\Entity\AclChangeset; +use Kunstmaan\AdminBundle\Entity\BaseUser; use Kunstmaan\AdminBundle\Entity\Role; use Kunstmaan\UtilitiesBundle\Helper\Shell\Shell; use Symfony\Component\EventDispatcher\EventDispatcherInterface; diff --git a/src/Kunstmaan/AdminBundle/Helper/Security/OAuth/OAuthUserFinder.php b/src/Kunstmaan/AdminBundle/Helper/Security/OAuth/OAuthUserFinder.php index 472c2e319a..d179453f36 100644 --- a/src/Kunstmaan/AdminBundle/Helper/Security/OAuth/OAuthUserFinder.php +++ b/src/Kunstmaan/AdminBundle/Helper/Security/OAuth/OAuthUserFinder.php @@ -9,7 +9,7 @@ */ class OAuthUserFinder implements OAuthUserFinderInterface { - /** @var EntityManager */ + /** @var EntityManagerInterface */ private $em; /** @var string */ diff --git a/src/Kunstmaan/AdminBundle/Service/AclManager.php b/src/Kunstmaan/AdminBundle/Service/AclManager.php index d20a77a00c..9464d284e2 100644 --- a/src/Kunstmaan/AdminBundle/Service/AclManager.php +++ b/src/Kunstmaan/AdminBundle/Service/AclManager.php @@ -5,8 +5,10 @@ use Doctrine\ORM\EntityManagerInterface; use Kunstmaan\AdminBundle\Entity\AclChangeset; use Kunstmaan\AdminBundle\Helper\Security\Acl\Permission\PermissionAdmin; +use Kunstmaan\AdminBundle\Repository\AclChangesetRepository; use Kunstmaan\NodeBundle\Entity\Node; use Symfony\Component\Security\Acl\Domain\RoleSecurityIdentity; +use Symfony\Component\Security\Acl\Model\AclInterface; use Symfony\Component\Security\Acl\Model\MutableAclProviderInterface; use Symfony\Component\Security\Acl\Model\ObjectIdentityRetrievalStrategyInterface; @@ -41,7 +43,6 @@ public function updateNodeAcl(Node $originalNode, Node $nodeNewPage) $newAcl = $this->aclProvider->createAcl($newIdentity); $aces = $originalAcl->getObjectAces(); - /* @var EntryInterface $ace */ foreach ($aces as $ace) { $securityIdentity = $ace->getSecurityIdentity(); if ($securityIdentity instanceof RoleSecurityIdentity) { @@ -60,11 +61,10 @@ public function updateNodesAclToRole(array $nodes, $role, $mask) foreach ($nodes as $node) { $objectIdentity = $this->objectIdentityRetrievalStrategy->getObjectIdentity($node); - /** @var Acl $acl */ + /** @var AclInterface $acl */ $acl = $this->aclProvider->findAcl($objectIdentity); $securityIdentity = new RoleSecurityIdentity($role); - /** @var Entry $ace */ foreach ($acl->getObjectAces() as $index => $ace) { if (!$ace->getSecurityIdentity()->equals($securityIdentity)) { continue; diff --git a/src/Kunstmaan/AdminListBundle/DependencyInjection/Configuration.php b/src/Kunstmaan/AdminListBundle/DependencyInjection/Configuration.php index 68e68ed38a..9ec1c4711c 100644 --- a/src/Kunstmaan/AdminListBundle/DependencyInjection/Configuration.php +++ b/src/Kunstmaan/AdminListBundle/DependencyInjection/Configuration.php @@ -2,6 +2,7 @@ namespace Kunstmaan\AdminListBundle\DependencyInjection; +use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition; use Symfony\Component\Config\Definition\Builder\TreeBuilder; use Symfony\Component\Config\Definition\ConfigurationInterface; diff --git a/src/Kunstmaan/AdminListBundle/Tests/AdminList/FilterType/ORM/BooleanFilterTypeTest.php b/src/Kunstmaan/AdminListBundle/Tests/AdminList/FilterType/ORM/BooleanFilterTypeTest.php index 16b7aea25a..5b23d5c34c 100644 --- a/src/Kunstmaan/AdminListBundle/Tests/AdminList/FilterType/ORM/BooleanFilterTypeTest.php +++ b/src/Kunstmaan/AdminListBundle/Tests/AdminList/FilterType/ORM/BooleanFilterTypeTest.php @@ -3,16 +3,10 @@ namespace Kunstmaan\AdminListBundle\Tests\AdminList\FilterType\ORM; use Kunstmaan\AdminListBundle\AdminList\FilterType\ORM\BooleanFilterType; -use Kunstmaan\AdminListBundle\Tests\UnitTester; use Symfony\Component\HttpFoundation\Request; class BooleanFilterTypeTest extends BaseOrmFilterTest { - /** - * @var UnitTester - */ - protected $tester; - /** * @var BooleanFilterType */ diff --git a/src/Kunstmaan/AdminListBundle/Tests/AdminList/FilterType/ORM/DateFilterTypeTest.php b/src/Kunstmaan/AdminListBundle/Tests/AdminList/FilterType/ORM/DateFilterTypeTest.php index b9141ca11e..27af74bb39 100644 --- a/src/Kunstmaan/AdminListBundle/Tests/AdminList/FilterType/ORM/DateFilterTypeTest.php +++ b/src/Kunstmaan/AdminListBundle/Tests/AdminList/FilterType/ORM/DateFilterTypeTest.php @@ -4,17 +4,11 @@ use Doctrine\ORM\QueryBuilder; use Kunstmaan\AdminListBundle\AdminList\FilterType\ORM\DateFilterType; -use Kunstmaan\AdminListBundle\Tests\UnitTester; use ReflectionClass; use Symfony\Component\HttpFoundation\Request; class DateFilterTypeTest extends BaseOrmFilterTest { - /** - * @var UnitTester - */ - protected $tester; - /** * @var DateFilterType */ diff --git a/src/Kunstmaan/DashboardBundle/Command/Helper/Analytics/AbstractAnalyticsCommandHelper.php b/src/Kunstmaan/DashboardBundle/Command/Helper/Analytics/AbstractAnalyticsCommandHelper.php index 047b21e83e..21e5dc08ba 100644 --- a/src/Kunstmaan/DashboardBundle/Command/Helper/Analytics/AbstractAnalyticsCommandHelper.php +++ b/src/Kunstmaan/DashboardBundle/Command/Helper/Analytics/AbstractAnalyticsCommandHelper.php @@ -4,6 +4,8 @@ use Doctrine\ORM\EntityManager; use Kunstmaan\DashboardBundle\Entity\AnalyticsOverview; +use Kunstmaan\DashboardBundle\Helper\Google\Analytics\ConfigHelper; +use Kunstmaan\DashboardBundle\Helper\Google\Analytics\QueryHelper; use Symfony\Component\Console\Output\OutputInterface; abstract class AbstractAnalyticsCommandHelper @@ -11,7 +13,7 @@ abstract class AbstractAnalyticsCommandHelper /** @var ConfigHelper */ protected $configHelper; - /** @var GooglequeryHelper */ + /** @var QueryHelper */ protected $query; /** @var EntityManager */ diff --git a/src/Kunstmaan/DashboardBundle/Entity/AnalyticsConfig.php b/src/Kunstmaan/DashboardBundle/Entity/AnalyticsConfig.php index d02235f931..44dd2a569a 100644 --- a/src/Kunstmaan/DashboardBundle/Entity/AnalyticsConfig.php +++ b/src/Kunstmaan/DashboardBundle/Entity/AnalyticsConfig.php @@ -75,7 +75,7 @@ class AnalyticsConfig extends AbstractEntity * * @param array $overviews * - * @return AnalyticsDailyOverviews + * @return self */ public function setOverviews($overviews) { @@ -99,7 +99,7 @@ public function getOverviews() * * @param array $segments * - * @return AnalyticsDailysegments + * @return self */ public function setSegments($segments) { @@ -133,7 +133,7 @@ public function getName() * * @param string $name * - * @return Analyticsname + * @return self */ public function setName($name) { diff --git a/src/Kunstmaan/DashboardBundle/Entity/AnalyticsOverview.php b/src/Kunstmaan/DashboardBundle/Entity/AnalyticsOverview.php index c52815a44e..d8c84fe85e 100644 --- a/src/Kunstmaan/DashboardBundle/Entity/AnalyticsOverview.php +++ b/src/Kunstmaan/DashboardBundle/Entity/AnalyticsOverview.php @@ -157,7 +157,7 @@ public function getConfig() * * @param int $config * - * @return AnalyticsTopReferrals + * @return self */ public function setConfig($config) { @@ -181,7 +181,7 @@ public function getSegment() * * @param int $segment * - * @return AnalyticsTopReferrals + * @return self */ public function setSegment($segment) { diff --git a/src/Kunstmaan/DashboardBundle/Entity/AnalyticsSegment.php b/src/Kunstmaan/DashboardBundle/Entity/AnalyticsSegment.php index 5a32750170..0e6d32bffd 100644 --- a/src/Kunstmaan/DashboardBundle/Entity/AnalyticsSegment.php +++ b/src/Kunstmaan/DashboardBundle/Entity/AnalyticsSegment.php @@ -100,7 +100,7 @@ public function getConfig() * * @param int $config * - * @return AnalyticsTopReferrals + * @return self */ public function setConfig($config) { diff --git a/src/Kunstmaan/DashboardBundle/Helper/Google/Analytics/ConfigHelper.php b/src/Kunstmaan/DashboardBundle/Helper/Google/Analytics/ConfigHelper.php index 34bb88bf7c..2e775ba8d6 100644 --- a/src/Kunstmaan/DashboardBundle/Helper/Google/Analytics/ConfigHelper.php +++ b/src/Kunstmaan/DashboardBundle/Helper/Google/Analytics/ConfigHelper.php @@ -4,6 +4,7 @@ use Doctrine\ORM\EntityManager; use Kunstmaan\DashboardBundle\Entity\AnalyticsConfig; +use Kunstmaan\DashboardBundle\Repository\AnalyticsConfigRepository; class ConfigHelper { diff --git a/src/Kunstmaan/DashboardBundle/Helper/Google/Analytics/ServiceHelper.php b/src/Kunstmaan/DashboardBundle/Helper/Google/Analytics/ServiceHelper.php index 06f5606ee9..6805e6aa41 100644 --- a/src/Kunstmaan/DashboardBundle/Helper/Google/Analytics/ServiceHelper.php +++ b/src/Kunstmaan/DashboardBundle/Helper/Google/Analytics/ServiceHelper.php @@ -10,7 +10,7 @@ class ServiceHelper /** @var Google_AnalyticsService */ private $service; - /** @var GoogleClientHelper */ + /** @var ClientHelper */ private $clientHelper; public function __construct(ClientHelper $clientHelper) diff --git a/src/Kunstmaan/FormBundle/Controller/FormSubmissionsController.php b/src/Kunstmaan/FormBundle/Controller/FormSubmissionsController.php index 3a6284cb09..fa3f8015a6 100644 --- a/src/Kunstmaan/FormBundle/Controller/FormSubmissionsController.php +++ b/src/Kunstmaan/FormBundle/Controller/FormSubmissionsController.php @@ -20,6 +20,7 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Security\Core\Exception\AccessDeniedException; /** * The controller which will handle everything related with form pages and form submissions diff --git a/src/Kunstmaan/FormBundle/EventListener/ConfigureActionsMenuListener.php b/src/Kunstmaan/FormBundle/EventListener/ConfigureActionsMenuListener.php index 42254e9dba..2f162d8819 100644 --- a/src/Kunstmaan/FormBundle/EventListener/ConfigureActionsMenuListener.php +++ b/src/Kunstmaan/FormBundle/EventListener/ConfigureActionsMenuListener.php @@ -5,6 +5,7 @@ use Doctrine\ORM\EntityManager; use Kunstmaan\FormBundle\Entity\AbstractFormPage; use Kunstmaan\NodeBundle\Event\ConfigureActionMenuEvent; +use Symfony\Component\Routing\Router; use Symfony\Component\Routing\RouterInterface; /** diff --git a/src/Kunstmaan/GeneratorBundle/Command/GenerateDefaultPagePartsCommand.php b/src/Kunstmaan/GeneratorBundle/Command/GenerateDefaultPagePartsCommand.php index f50c5ab5d9..a321c114cf 100644 --- a/src/Kunstmaan/GeneratorBundle/Command/GenerateDefaultPagePartsCommand.php +++ b/src/Kunstmaan/GeneratorBundle/Command/GenerateDefaultPagePartsCommand.php @@ -4,6 +4,7 @@ use Kunstmaan\GeneratorBundle\Generator\DefaultPagePartGenerator; use Symfony\Component\Console\Input\InputOption; +use Symfony\Component\HttpKernel\Bundle\BundleInterface; /** * Generates the default pageparts diff --git a/src/Kunstmaan/GeneratorBundle/Command/GenerateDefaultSiteCommand.php b/src/Kunstmaan/GeneratorBundle/Command/GenerateDefaultSiteCommand.php index 1b8d79b867..34c9b422ce 100644 --- a/src/Kunstmaan/GeneratorBundle/Command/GenerateDefaultSiteCommand.php +++ b/src/Kunstmaan/GeneratorBundle/Command/GenerateDefaultSiteCommand.php @@ -6,6 +6,7 @@ use Symfony\Component\Console\Input\ArrayInput; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\ConsoleOutput; +use Symfony\Component\HttpKernel\Bundle\BundleInterface; /** * Generates a default website based on Kunstmaan bundles diff --git a/src/Kunstmaan/GeneratorBundle/Command/GenerateFormPagePartsCommand.php b/src/Kunstmaan/GeneratorBundle/Command/GenerateFormPagePartsCommand.php index 9c2b9c09e8..15ed62a97f 100644 --- a/src/Kunstmaan/GeneratorBundle/Command/GenerateFormPagePartsCommand.php +++ b/src/Kunstmaan/GeneratorBundle/Command/GenerateFormPagePartsCommand.php @@ -4,6 +4,7 @@ use Kunstmaan\GeneratorBundle\Generator\DefaultPagePartGenerator; use Symfony\Component\Console\Input\InputOption; +use Symfony\Component\HttpKernel\Bundle\BundleInterface; /** * Generates the default form pageparts diff --git a/src/Kunstmaan/GeneratorBundle/Command/GenerateLayoutCommand.php b/src/Kunstmaan/GeneratorBundle/Command/GenerateLayoutCommand.php index cbb07f7ccd..8e3a982693 100644 --- a/src/Kunstmaan/GeneratorBundle/Command/GenerateLayoutCommand.php +++ b/src/Kunstmaan/GeneratorBundle/Command/GenerateLayoutCommand.php @@ -4,6 +4,7 @@ use Kunstmaan\GeneratorBundle\Generator\LayoutGenerator; use Symfony\Component\Console\Input\InputOption; +use Symfony\Component\HttpKernel\Bundle\BundleInterface; /** * Generates de default layout diff --git a/src/Kunstmaan/GeneratorBundle/Command/GeneratePagePartCommand.php b/src/Kunstmaan/GeneratorBundle/Command/GeneratePagePartCommand.php index 068d2a89c2..6a2cf602a4 100644 --- a/src/Kunstmaan/GeneratorBundle/Command/GeneratePagePartCommand.php +++ b/src/Kunstmaan/GeneratorBundle/Command/GeneratePagePartCommand.php @@ -4,6 +4,7 @@ use Kunstmaan\GeneratorBundle\Generator\PagePartGenerator; use Symfony\Component\Console\Input\InputOption; +use Symfony\Component\HttpKernel\Bundle\BundleInterface; /** * Generates a new pagepart diff --git a/src/Kunstmaan/LeadGenerationBundle/Entity/Rule/AbstractRule.php b/src/Kunstmaan/LeadGenerationBundle/Entity/Rule/AbstractRule.php index fa395b05b5..7f921d9085 100644 --- a/src/Kunstmaan/LeadGenerationBundle/Entity/Rule/AbstractRule.php +++ b/src/Kunstmaan/LeadGenerationBundle/Entity/Rule/AbstractRule.php @@ -4,7 +4,7 @@ use Doctrine\ORM\Mapping as ORM; use Kunstmaan\LeadGenerationBundle\Entity\Popup\AbstractPopup; -use Kunstmaan\LeadGenerationBundle\Form\AbstractRuleAdminType; +use Kunstmaan\LeadGenerationBundle\Form\Rule\AbstractRuleAdminType; use Kunstmaan\LeadGenerationBundle\Service\RuleServiceInterface; /** diff --git a/src/Kunstmaan/LeadGenerationBundle/Entity/Rule/AfterXScrollPercentRule.php b/src/Kunstmaan/LeadGenerationBundle/Entity/Rule/AfterXScrollPercentRule.php index c652c521a5..c58ac6b2f8 100644 --- a/src/Kunstmaan/LeadGenerationBundle/Entity/Rule/AfterXScrollPercentRule.php +++ b/src/Kunstmaan/LeadGenerationBundle/Entity/Rule/AfterXScrollPercentRule.php @@ -34,7 +34,7 @@ public function getPercentage() /** * @param int $percentage * - * @return AfterXScrollPercent + * @return self */ public function setPercentage($percentage) { diff --git a/src/Kunstmaan/MediaBundle/Command/RenameSoftDeletedCommand.php b/src/Kunstmaan/MediaBundle/Command/RenameSoftDeletedCommand.php index 0d00a51978..731a89aa73 100644 --- a/src/Kunstmaan/MediaBundle/Command/RenameSoftDeletedCommand.php +++ b/src/Kunstmaan/MediaBundle/Command/RenameSoftDeletedCommand.php @@ -6,6 +6,7 @@ use Doctrine\ORM\EntityManagerInterface; use Kunstmaan\MediaBundle\Entity\Media; use Kunstmaan\MediaBundle\Helper\File\FileHandler; +use Kunstmaan\MediaBundle\Helper\MediaManager; use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; @@ -105,7 +106,7 @@ public function execute(InputInterface $input, OutputInterface $output) } foreach ($fileRenameQueue as $row) { - list($oldFileUrl, $newFileUrl, $handler) = $row; + [$oldFileUrl, $newFileUrl, $handler] = $row; $handler->fileSystem->rename( preg_replace('~^' . preg_quote($handler->mediaPath, '~') . '~', '/', $oldFileUrl), preg_replace('~^' . preg_quote($handler->mediaPath, '~') . '~', '/', $newFileUrl) diff --git a/src/Kunstmaan/NodeBundle/Entity/QueuedNodeTranslationAction.php b/src/Kunstmaan/NodeBundle/Entity/QueuedNodeTranslationAction.php index b5e3de4085..20af720ce4 100644 --- a/src/Kunstmaan/NodeBundle/Entity/QueuedNodeTranslationAction.php +++ b/src/Kunstmaan/NodeBundle/Entity/QueuedNodeTranslationAction.php @@ -130,7 +130,7 @@ public function setDate(\DateTime $date) /** * Get date * - * @return DateTime + * @return \DateTime */ public function getDate() { diff --git a/src/Kunstmaan/NodeBundle/Helper/FormWidgets/PermissionsFormWidget.php b/src/Kunstmaan/NodeBundle/Helper/FormWidgets/PermissionsFormWidget.php index 3adb5b951a..363c470f6e 100644 --- a/src/Kunstmaan/NodeBundle/Helper/FormWidgets/PermissionsFormWidget.php +++ b/src/Kunstmaan/NodeBundle/Helper/FormWidgets/PermissionsFormWidget.php @@ -92,7 +92,7 @@ public function getTemplate() /** * @param string $identifier * - * @return TabInterface + * @return self */ public function setIdentifier($identifier) { @@ -112,7 +112,7 @@ public function getIdentifier() /** * @param HasNodeInterface $page * - * @return PermissionTab + * @return self */ public function setPage($page) { @@ -132,7 +132,7 @@ public function getPage() /** * @param PermissionAdmin $permissionAdmin * - * @return PermissionTab + * @return self */ public function setPermissionAdmin($permissionAdmin) { @@ -152,7 +152,7 @@ public function getPermissionAdmin() /** * @param PermissionMapInterface $permissionMap * - * @return PermissionTab + * @return self */ public function setPermissionMap($permissionMap) { diff --git a/src/Kunstmaan/NodeBundle/Helper/NodeMenu.php b/src/Kunstmaan/NodeBundle/Helper/NodeMenu.php index 696ba515ad..be3a58f5a7 100644 --- a/src/Kunstmaan/NodeBundle/Helper/NodeMenu.php +++ b/src/Kunstmaan/NodeBundle/Helper/NodeMenu.php @@ -3,6 +3,7 @@ namespace Kunstmaan\NodeBundle\Helper; use Doctrine\ORM\EntityManagerInterface; +use Kunstmaan\AdminBundle\Entity\BaseUser; use Kunstmaan\AdminBundle\Helper\DomainConfigurationInterface; use Kunstmaan\AdminBundle\Helper\Security\Acl\AclHelper; use Kunstmaan\AdminBundle\Helper\Security\Acl\Permission\PermissionMap; diff --git a/src/Kunstmaan/NodeBundle/Tests/Helper/NodeHelperTest.php b/src/Kunstmaan/NodeBundle/Tests/Helper/NodeHelperTest.php index 273416678a..ba629a5420 100644 --- a/src/Kunstmaan/NodeBundle/Tests/Helper/NodeHelperTest.php +++ b/src/Kunstmaan/NodeBundle/Tests/Helper/NodeHelperTest.php @@ -26,6 +26,7 @@ use Kunstmaan\NodeBundle\Repository\NodeTranslationRepository; use Kunstmaan\NodeBundle\Repository\NodeVersionRepository; use Kunstmaan\NodeBundle\ValueObject\PageTab; +use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; use Symfony\Component\EventDispatcher\EventDispatcher; use Symfony\Component\EventDispatcher\LegacyEventDispatcherProxy; @@ -86,25 +87,25 @@ public function configureOptions(OptionsResolver $resolver) class NodeHelperTest extends TestCase { - /** @var \PHPUnit_Framework_MockObject_MockObject|EntityManagerInterface */ + /** @var MockObject|EntityManagerInterface */ private $em; - /** @var \PHPUnit_Framework_MockObject_MockObject|NodeRepository */ + /** @var MockObject|NodeRepository */ private $repository; /** @var NodeHelper */ private $nodeHelper; - /** @var \PHPUnit_Framework_MockObject_MockObject|NodeAdminPublisher */ + /** @var MockObject|NodeAdminPublisher */ private $nodeAdminPublisher; - /** @var \PHPUnit_Framework_MockObject_MockObject|EventDispatcher */ + /** @var MockObject|EventDispatcher */ private $eventDispatcher; - /** @var \PHPUnit_Framework_MockObject_MockObject|TokenStorageInterface */ + /** @var MockObject|TokenStorageInterface */ private $tokenStorage; - /** @var \PHPUnit_Framework_MockObject_MockObject|CloneHelper */ + /** @var MockObject|CloneHelper */ private $cloneHelper; /** @var string */ @@ -318,7 +319,7 @@ public function testPrepareNodeVersionForDraft() $nodeTranslation->setLang($this->locale); $nodeTranslation->addNodeVersion($nodeVersion); - /** @var \PHPUnit_Framework_MockObject_MockObject|NodeHelper $nodeHelper */ + /** @var MockObject|NodeHelper $nodeHelper */ $nodeHelper = $this->getMockBuilder(NodeHelper::class) ->setConstructorArgs([ $this->em, diff --git a/src/Kunstmaan/PagePartBundle/Tests/EventListener/CloneListenerTest.php b/src/Kunstmaan/PagePartBundle/Tests/EventListener/CloneListenerTest.php index 0bc8550836..e65ad7c1eb 100644 --- a/src/Kunstmaan/PagePartBundle/Tests/EventListener/CloneListenerTest.php +++ b/src/Kunstmaan/PagePartBundle/Tests/EventListener/CloneListenerTest.php @@ -29,7 +29,7 @@ class CloneListenerTest extends TestCase private $configurator; /** - * @var \Doctrine\ORM\EntityRepository|\PHPUnit_Framework_MockObject_MockObject + * @var \Doctrine\ORM\EntityRepository|MockObject */ private $repo; @@ -39,12 +39,12 @@ class CloneListenerTest extends TestCase private $object; /** - * @var PagePartConfigurationReaderInterface|\PHPUnit_Framework_MockObject_MockObject + * @var PagePartConfigurationReaderInterface|MockObject */ private $reader; /** - * @var PageTemplateConfigurationService|\PHPUnit_Framework_MockObject_MockObject + * @var PageTemplateConfigurationService|MockObject */ private $templateService; @@ -100,7 +100,7 @@ public function testClonePageTemplate() { $entity = $this->createMock(HasPageTemplateInterface::class); - /** @var HasPageTemplateInterface|\PHPUnit_Framework_MockObject_MockObject $clone */ + /** @var HasPageTemplateInterface|MockObject $clone */ $clone = clone $entity; $entity->expects($this->any()) diff --git a/src/Kunstmaan/PagePartBundle/Twig/Extension/PagePartAdminTwigExtension.php b/src/Kunstmaan/PagePartBundle/Twig/Extension/PagePartAdminTwigExtension.php index b7997016fc..0f476349bb 100644 --- a/src/Kunstmaan/PagePartBundle/Twig/Extension/PagePartAdminTwigExtension.php +++ b/src/Kunstmaan/PagePartBundle/Twig/Extension/PagePartAdminTwigExtension.php @@ -14,6 +14,7 @@ */ class PagePartAdminTwigExtension extends AbstractExtension { + /** @var bool */ private $usesExtendedPagePartChooser = false; /** @@ -65,7 +66,7 @@ public function renderWidget(Environment $env, PagePartAdmin $ppAdmin, $form = n /** * Get usesExtendedPagePartChooser. * - * @return usesExtendedPagePartChooser + * @return bool */ public function getUsesExtendedPagePartChooser() { @@ -75,7 +76,7 @@ public function getUsesExtendedPagePartChooser() /** * Set usesExtendedPagePartChooser. * - * @param usesExtendedPagePartChooser the value to set + * @param bool the value to set */ public function setUsesExtendedPagePartChooser($usesExtendedPagePartChooser) { diff --git a/src/Kunstmaan/TaggingBundle/Entity/Tag.php b/src/Kunstmaan/TaggingBundle/Entity/Tag.php index 45b34b3150..561f0fdf09 100644 --- a/src/Kunstmaan/TaggingBundle/Entity/Tag.php +++ b/src/Kunstmaan/TaggingBundle/Entity/Tag.php @@ -108,7 +108,7 @@ public function setCreatedAt(\DateTime $createdAt) /** * Get createdAt * - * @return datetime + * @return \DateTime */ public function getCreatedAt() { diff --git a/src/Kunstmaan/TaggingBundle/Entity/Tagging.php b/src/Kunstmaan/TaggingBundle/Entity/Tagging.php index cd0583014e..6483232fa4 100644 --- a/src/Kunstmaan/TaggingBundle/Entity/Tagging.php +++ b/src/Kunstmaan/TaggingBundle/Entity/Tagging.php @@ -138,7 +138,7 @@ public function setCreatedAt(\DateTime $createdAt) /** * Get createdAt * - * @return datetime + * @return \DateTime */ public function getCreatedAt() { @@ -158,7 +158,7 @@ public function setUpdatedAt(\DateTime $updatedAt) /** * Get updatedAt * - * @return datetime + * @return \DateTime */ public function getUpdatedAt() { diff --git a/src/Kunstmaan/TaggingBundle/Form/DataTransformer/TagsTransformer.php b/src/Kunstmaan/TaggingBundle/Form/DataTransformer/TagsTransformer.php index b44412561c..7e5b80dd5e 100644 --- a/src/Kunstmaan/TaggingBundle/Form/DataTransformer/TagsTransformer.php +++ b/src/Kunstmaan/TaggingBundle/Form/DataTransformer/TagsTransformer.php @@ -16,32 +16,7 @@ public function __construct(TagManager $tagManager) } /** - * Transforms a value from the original representation to a transformed representation. - * - * This method is called on two occasions inside a form field: - * - * 1. When the form field is initialized with the data attached from the datasource (object or array). - * 2. When data from a request is bound using {@link Field::bind()} to transform the new input data - * back into the renderable format. For example if you have a date field and bind '2009-10-10' onto - * it you might accept this value because its easily parsed, but the transformer still writes back - * "2009/10/10" onto the form field (for further displaying or other purposes). - * - * This method must be able to deal with empty values. Usually this will - * be NULL, but depending on your implementation other empty values are - * possible as well (such as empty strings). The reasoning behind this is - * that value transformers must be chainable. If the transform() method - * of the first value transformer outputs NULL, the second value transformer - * must be able to process that value. - * - * By convention, transform() should return an empty string if NULL is - * passed. - * - * @param mixed $value The value in the original representation - * - * @return mixed The value in the transformed representation - * - * @throws UnexpectedTypeException when the argument is not a string - * @throws TransformationFailedException when the transformation fails + * {@inheritdoc} */ public function transform($value) { @@ -59,29 +34,7 @@ public function transform($value) } /** - * Transforms a value from the transformed representation to its originalœ - * representation. - * - * This method is called when {@link Field::bind()} is called to transform the requests tainted data - * into an acceptable format for your data processing/model layer. - *œ - * This method must be able to deal with empty values. Usually this will - * be an empty string, but depending on your implementation other empty - * values are possible as well (such as empty strings). The reasoning behind - * this is that value transformers must be chainable. If the - * reverseTransform() method of the first value transformer outputs an - * empty string, the second value transformer must be able to process that - * value. - * - * By convention, reverseTransform() should return NULL if an empty string - * is passed. - * - * @param mixed $value The value in the transformed representation - * - * @return mixed The value in the original representation - * - * @throws UnexpectedTypeException when the argument is not of the expected type - * @throws TransformationFailedException when the transformation fails + * {@inheritdoc} */ public function reverseTransform($value) { diff --git a/src/Kunstmaan/TranslatorBundle/AdminList/TranslationAdminListConfigurator.php b/src/Kunstmaan/TranslatorBundle/AdminList/TranslationAdminListConfigurator.php index adc7edab08..27ee8f71af 100644 --- a/src/Kunstmaan/TranslatorBundle/AdminList/TranslationAdminListConfigurator.php +++ b/src/Kunstmaan/TranslatorBundle/AdminList/TranslationAdminListConfigurator.php @@ -8,6 +8,7 @@ use Kunstmaan\AdminListBundle\AdminList\Configurator\ChangeableLimitInterface; use Kunstmaan\AdminListBundle\AdminList\Field; use Kunstmaan\AdminListBundle\AdminList\FieldAlias; +use Kunstmaan\AdminListBundle\AdminList\FilterType\DBAL\AbstractDBALFilterType; use Kunstmaan\AdminListBundle\AdminList\FilterType\DBAL\EnumerationFilterType; use Kunstmaan\AdminListBundle\AdminList\FilterType\DBAL\StringFilterType; use Kunstmaan\AdminListBundle\Traits\ChangeableLimitTrait; diff --git a/src/Kunstmaan/TranslatorBundle/DataFixtures/ORM/TranslationFixtures.php b/src/Kunstmaan/TranslatorBundle/DataFixtures/ORM/TranslationFixtures.php index e2d248212b..5fb15c584f 100644 --- a/src/Kunstmaan/TranslatorBundle/DataFixtures/ORM/TranslationFixtures.php +++ b/src/Kunstmaan/TranslatorBundle/DataFixtures/ORM/TranslationFixtures.php @@ -7,6 +7,7 @@ use Doctrine\Persistence\ObjectManager; use Kunstmaan\TranslatorBundle\Entity\Translation as Entity; use Kunstmaan\TranslatorBundle\Model\Translation as Model; +use Kunstmaan\TranslatorBundle\Repository\TranslationRepository; /** * Fixture for creation the basic translations @@ -14,7 +15,7 @@ class TranslationFixtures extends AbstractFixture implements OrderedFixtureInterface { /** - * @var Kunstmaan\TranslatorBundle\Repository\TranslationRepository + * @var TranslationRepository */ protected $repo; diff --git a/src/Kunstmaan/TranslatorBundle/Model/Translation/TranslationGroup.php b/src/Kunstmaan/TranslatorBundle/Model/Translation/TranslationGroup.php index afcfafa9ff..b42a679790 100644 --- a/src/Kunstmaan/TranslatorBundle/Model/Translation/TranslationGroup.php +++ b/src/Kunstmaan/TranslatorBundle/Model/Translation/TranslationGroup.php @@ -2,6 +2,7 @@ namespace Kunstmaan\TranslatorBundle\Model\Translation; +use Doctrine\Common\Collections\ArrayCollection; use Kunstmaan\TranslatorBundle\Entity\Translation; /** @@ -17,7 +18,7 @@ class TranslationGroup /** * All translations for a specific key (Kunstmaan\TranslatorBundle\Model\Translation\Translation) * - * @var Doctrine\Common\Collections\ArrayCollection + * @var ArrayCollection **/ private $translations; @@ -37,7 +38,7 @@ class TranslationGroup public function __construct() { - $this->translations = new \Doctrine\Common\Collections\ArrayCollection(); + $this->translations = new ArrayCollection(); } public function hasTranslation($locale) diff --git a/src/Kunstmaan/TranslatorBundle/Service/TranslationGroupManager.php b/src/Kunstmaan/TranslatorBundle/Service/TranslationGroupManager.php index 4c31c6f262..c175051459 100644 --- a/src/Kunstmaan/TranslatorBundle/Service/TranslationGroupManager.php +++ b/src/Kunstmaan/TranslatorBundle/Service/TranslationGroupManager.php @@ -2,7 +2,7 @@ namespace Kunstmaan\TranslatorBundle\Service; -use Kunstmaan\TranslatorBundle\Model\Translation\Translation; +use Kunstmaan\TranslatorBundle\Entity\Translation; use Kunstmaan\TranslatorBundle\Model\Translation\TranslationGroup; use Kunstmaan\TranslatorBundle\Repository\TranslationRepository; @@ -31,7 +31,7 @@ public function __construct(TranslationRepository $translationRepository) */ public function addTranslation(TranslationGroup $translationGroup, $locale, $text, $filename) { - $translation = new \Kunstmaan\TranslatorBundle\Entity\Translation(); + $translation = new Translation(); $translation->setLocale($locale); $translation->setText($text); $translation->setDomain($translationGroup->getDomain()); @@ -91,7 +91,7 @@ private function findTranslations($keyword, $domain) { $result = []; - /** @var \Kunstmaan\TranslatorBundle\Entity\Translation $translation */ + /** @var Translation $translation */ foreach ($this->dbCopy as $translation) { if ($translation->getKeyword() === $keyword && $translation->getDomain() === $domain) { $result[] = $translation; diff --git a/src/Kunstmaan/TranslatorBundle/Service/Translator/ResourceCacher.php b/src/Kunstmaan/TranslatorBundle/Service/Translator/ResourceCacher.php index 9b0c0697e0..8e7b03797f 100644 --- a/src/Kunstmaan/TranslatorBundle/Service/Translator/ResourceCacher.php +++ b/src/Kunstmaan/TranslatorBundle/Service/Translator/ResourceCacher.php @@ -2,6 +2,7 @@ namespace Kunstmaan\TranslatorBundle\Service\Translator; +use Psr\Log\LoggerInterface; use Symfony\Component\Config\ConfigCache; use Symfony\Component\Finder\Finder; @@ -25,14 +26,14 @@ class ResourceCacher /** * Logger * - * @var \Symfony\Component\HttpKernel\Log\LoggerInterface + * @var LoggerInterface */ private $logger; /** * Retrieve resources from cache file (if any) * - * @return resources false if empty + * @return array|false false if empty */ public function getCachedResources() { diff --git a/src/Kunstmaan/TranslatorBundle/Service/Translator/Translator.php b/src/Kunstmaan/TranslatorBundle/Service/Translator/Translator.php index 051b7f5a0a..75051b2a1f 100644 --- a/src/Kunstmaan/TranslatorBundle/Service/Translator/Translator.php +++ b/src/Kunstmaan/TranslatorBundle/Service/Translator/Translator.php @@ -22,7 +22,7 @@ class Translator extends SymfonyTranslator /** * Resource Cacher * - * @var Kunstmaan\TranslatorBundle\Service\Translator\ResourceCacher + * @var ResourceCacher */ private $resourceCacher; diff --git a/src/Kunstmaan/VotingBundle/Services/RepositoryResolver.php b/src/Kunstmaan/VotingBundle/Services/RepositoryResolver.php index 8ea5788cd3..f7e053e08c 100644 --- a/src/Kunstmaan/VotingBundle/Services/RepositoryResolver.php +++ b/src/Kunstmaan/VotingBundle/Services/RepositoryResolver.php @@ -3,6 +3,8 @@ namespace Kunstmaan\VotingBundle\Services; use Doctrine\ORM\EntityManager; +use Doctrine\ORM\EntityRepository; +use Kunstmaan\VotingBundle\Event\EventInterface; use Kunstmaan\VotingBundle\Event\Facebook\FacebookLikeEvent; use Kunstmaan\VotingBundle\Event\Facebook\FacebookSendEvent; use Kunstmaan\VotingBundle\Event\LinkedIn\LinkedInShareEvent; @@ -30,9 +32,9 @@ public function __construct(EntityManager $em) /** * Return repository for event * - * @param Event $event event + * @param EventInterface $event event * - * @return Repository + * @return EntityRepository */ public function getRepositoryForEvent($event) { @@ -66,7 +68,7 @@ public function getRepositoryForEvent($event) * * @param string $name name * - * @return Repository + * @return EntityRepository */ protected function getRepository($name) {