Code Duplication    Length = 16-17 lines in 4 locations

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

@@ 43-59 (lines=17) @@
40
     * @param EntityManagerInterface|null $em
41
     * @param PdfTransformer|null         $mediaManager
42
     */
43
    public function __construct(/* EntityManagerInterface */ $em = null, /* PdfTransformer */ $pdfTransformer = null, $rootDir = null, $enablePdfPreview = null)
44
    {
45
        parent::__construct();
46
47
        if (!$em instanceof EntityManagerInterface) {
48
            @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);
49
50
            $this->setName(null === $em ? 'kuma:media:create-pdf-previews' : $em);
51
52
            return;
53
        }
54
55
        $this->em = $em;
56
        $this->pdfTransformer = $pdfTransformer;
57
        $this->rootDir = $rootDir;
58
        $this->enablePdfPreview = $enablePdfPreview;
59
    }
60
61
    protected function configure()
62
    {

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/AdminBundle/Command/UpdateAclCommand.php 1 location

@@ 36-52 (lines=17) @@
33
    /** @var  */
34
    private $roles;
35
36
    public function __construct(/*AclManager*/ $aclManager = null, EntityManagerInterface $em = null, PermissionMapInterface $permissionMap = null, array $roles = null)
37
    {
38
        parent::__construct();
39
40
        if (!$aclManager instanceof AclManager) {
41
            @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);
42
43
            $this->setName(null === $aclManager ? 'kuma:acl:update' : $aclManager);
44
45
            return;
46
        }
47
48
        $this->aclManager = $aclManager;
49
        $this->em = $em;
50
        $this->permissionMap = $permissionMap;
51
        $this->roles = $roles;
52
    }
53
54
    /**
55
     * {@inheritdoc}