Code Duplication    Length = 15-25 lines in 7 locations

src/Kunstmaan/DashboardBundle/Command/GoogleAnalyticsDataCollectCommand.php 1 location

@@ 39-53 (lines=15) @@
36
     * @param EntityManagerInterface|null $em
37
     * @param ServiceHelper               $serviceHelper
38
     */
39
    public function __construct(/* EntityManagerInterface */ $em = null, ServiceHelper $serviceHelper = null)
40
    {
41
        parent::__construct();
42
43
        if (!$em instanceof EntityManagerInterface) {
44
            @trigger_error(sprintf('Passing a command name as the first argument of "%s" is deprecated since version symfony 3.4 and will be removed in symfony 4.0. If the command was registered by convention, make it a service instead. ', __METHOD__), E_USER_DEPRECATED);
45
46
            $this->setName(null === $em ? 'kuma:dashboard:widget:googleanalytics:data:collect' : $em);
47
48
            return;
49
        }
50
51
        $this->em = $em;
52
        $this->serviceHelper = $serviceHelper;
53
    }
54
55
    /**
56
     * Configures the current command.

src/Kunstmaan/MediaBundle/Command/CleanDeletedMediaCommand.php 1 location

@@ 34-48 (lines=15) @@
31
     * @param EntityManagerInterface|null $em
32
     * @param MediaManager|null           $mediaManager
33
     */
34
    public function __construct(/* EntityManagerInterface */ $em = null, /* MediaManager */ $mediaManager = null)
35
    {
36
        parent::__construct();
37
38
        if (!$em instanceof EntityManagerInterface) {
39
            @trigger_error(sprintf('Passing a command name as the first argument of "%s" is deprecated since version symfony 3.4 and will be removed in symfony 4.0. If the command was registered by convention, make it a service instead. ', __METHOD__), E_USER_DEPRECATED);
40
41
            $this->setName(null === $em ? 'kuma:media:clean-deleted-media' : $em);
42
43
            return;
44
        }
45
46
        $this->em = $em;
47
        $this->mediaManager = $mediaManager;
48
    }
49
50
    protected function configure()
51
    {

src/Kunstmaan/MediaBundle/Command/RenameSoftDeletedCommand.php 1 location

@@ 32-46 (lines=15) @@
29
     * @param EntityManagerInterface|null $em
30
     * @param MediaManager|null           $mediaManager
31
     */
32
    public function __construct(/* EntityManagerInterface */ $em = null, /* MediaManager */ $mediaManager = null)
33
    {
34
        parent::__construct();
35
36
        if (!$em instanceof EntityManagerInterface) {
37
            @trigger_error(sprintf('Passing a command name as the first argument of "%s" is deprecated since version symfony 3.4 and will be removed in symfony 4.0. If the command was registered by convention, make it a service instead. ', __METHOD__), E_USER_DEPRECATED);
38
39
            $this->setName(null === $em ? 'kuma:media:rename-soft-deleted' : $em);
40
41
            return;
42
        }
43
44
        $this->em = $em;
45
        $this->mediaManager = $mediaManager;
46
    }
47
48
    protected function configure()
49
    {

src/Kunstmaan/NodeBundle/Command/CronUpdateNodeCommand.php 1 location

@@ 41-56 (lines=16) @@
38
     * @param TokenStorage|null           $tokenStorage
39
     * @param NodeAdminPublisher|null     $nodePublisher
40
     */
41
    public function __construct(/* EntityManagerInterface */ $em = null, /* TokenStorage */$tokenStorage = null, /* NodeAdminPublisher */ $nodePublisher = null)
42
    {
43
        parent::__construct();
44
45
        if (!$em instanceof EntityManagerInterface) {
46
            @trigger_error(sprintf('Passing a command name as the first argument of "%s" is deprecated since version symfony 3.4 and will be removed in symfony 4.0. If the command was registered by convention, make it a service instead. ', __METHOD__), E_USER_DEPRECATED);
47
48
            $this->setName(null === $em ? 'kuma:nodes:cron' : $em);
49
50
            return;
51
        }
52
53
        $this->em = $em;
54
        $this->tokenStorage = $tokenStorage;
55
        $this->nodePublisher = $nodePublisher;
56
    }
57
58
    /**
59
     * {@inheritdoc}

src/Kunstmaan/NodeBundle/Command/InitAclCommand.php 1 location

@@ 44-59 (lines=16) @@
41
     * @param MutableAclProviderInterface|null              $aclProvider
42
     * @param ObjectIdentityRetrievalStrategyInterface|null $oidStrategy
43
     */
44
    public function __construct(/* EntityManagerInterface */ $em = null, /* MutableAclProviderInterface */ $aclProvider = null, /* ObjectIdentityRetrievalStrategyInterface */ $oidStrategy = null)
45
    {
46
        parent::__construct();
47
48
        if (!$em instanceof EntityManagerInterface) {
49
            @trigger_error(sprintf('Passing a command name as the first argument of "%s" is deprecated since version symfony 3.4 and will be removed in symfony 4.0. If the command was registered by convention, make it a service instead. ', __METHOD__), E_USER_DEPRECATED);
50
51
            $this->setName(null === $em ? 'kuma:init:acl' : $em);
52
53
            return;
54
        }
55
56
        $this->em = $em;
57
        $this->aclProvider = $aclProvider;
58
        $this->oidStrategy = $oidStrategy;
59
    }
60
61
    /**
62
     * {@inheritdoc}

src/Kunstmaan/TranslatorBundle/Command/ImportTranslationsCommand.php 1 location

@@ 45-69 (lines=25) @@
42
     * @param string               $defaultBundle
43
     * @param array                $bundles
44
     */
45
    public function __construct(/* ImportCommandHandler */
46
        $importCommandHandler = null,
47
        string $defaultBundle,
48
        array $bundles
49
    ) {
50
        parent::__construct();
51
52
        if (!$importCommandHandler instanceof ImportCommandHandler) {
53
            @trigger_error(
54
                sprintf(
55
                    'Passing a command name as the first argument of "%s" is deprecated since version symfony 3.4 and will be removed in symfony 4.0. If the command was registered by convention, make it a service instead. ',
56
                    __METHOD__
57
                ),
58
                E_USER_DEPRECATED
59
            );
60
61
            $this->setName(null === $importCommandHandler ? 'kuma:translator:import' : $importCommandHandler);
62
63
            return;
64
        }
65
66
        $this->importCommandHandler = $importCommandHandler;
67
        $this->defaultBundle = $defaultBundle;
68
        $this->bundles = $bundles;
69
    }
70
71
    /**
72
     * Configures this command.

src/Kunstmaan/TranslatorBundle/Command/TranslationCacheCommand.php 1 location

@@ 33-47 (lines=15) @@
30
     * @param ResourceCacher|null $resourceCacher
31
     * @param CacheValidator|null $cacheValidator
32
     */
33
    public function __construct(/* ResourceCacher */ $resourceCacher = null, /* CacheValidator */ $cacheValidator = null)
34
    {
35
        parent::__construct();
36
37
        if (!$resourceCacher instanceof ResourceCacher) {
38
            @trigger_error(sprintf('Passing a command name as the first argument of "%s" is deprecated since version symfony 3.4 and will be removed in symfony 4.0. If the command was registered by convention, make it a service instead. ', __METHOD__), E_USER_DEPRECATED);
39
40
            $this->setName(null === $resourceCacher ? 'kuma:translator:cache' : $resourceCacher);
41
42
            return;
43
        }
44
45
        $this->resourceCacher = $resourceCacher;
46
        $this->cacheValidator = $cacheValidator;
47
    }
48
49
    protected function configure()
50
    {