Code Duplication    Length = 12-12 lines in 3 locations

src/TreeHouse/IoBundle/Bridge/WorkerBundle/Executor/ScrapeRevisitSourceExecutor.php 1 location

@@ 78-89 (lines=12) @@
75
    /**
76
     * @inheritdoc
77
     */
78
    public function configurePayload(OptionsResolver $resolver)
79
    {
80
        $resolver->setRequired(0);
81
        $resolver->setAllowedTypes(0, 'numeric');
82
        $resolver->setNormalizer(0, function (Options $options, $value) {
83
            if (null === $source = $this->findSource($value)) {
84
                throw new InvalidArgumentException(sprintf('Could not find source with id %d', $value));
85
            }
86
87
            return $source;
88
        });
89
    }
90
91
    /**
92
     * @inheritdoc

src/TreeHouse/IoBundle/Bridge/WorkerBundle/Executor/SourceProcessExecutor.php 1 location

@@ 87-98 (lines=12) @@
84
    /**
85
     * @inheritdoc
86
     */
87
    public function configurePayload(OptionsResolver $resolver)
88
    {
89
        $resolver->setRequired(0);
90
        $resolver->setAllowedTypes(0, 'numeric');
91
        $resolver->setNormalizer(0, function (Options $options, $value) {
92
            if (null === $source = $this->findSource($value)) {
93
                throw new InvalidArgumentException(sprintf('Could not find source with id %d', $value));
94
            }
95
96
            return $source;
97
        });
98
    }
99
100
    /**
101
     * @param array $payload Payload containing the source id

src/TreeHouse/IoBundle/Bridge/WorkerBundle/Executor/ImportPartExecutor.php 1 location

@@ 77-88 (lines=12) @@
74
    /**
75
     * @inheritdoc
76
     */
77
    public function configurePayload(OptionsResolver $resolver)
78
    {
79
        $resolver->setRequired(0);
80
        $resolver->setAllowedTypes(0, 'numeric');
81
        $resolver->setNormalizer(0, function (Options $options, $value) {
82
            if (null === $part = $this->findImportPart($value)) {
83
                throw new InvalidArgumentException(sprintf('Import part with id "%d" does not exist', $value));
84
            }
85
86
            return $part;
87
        });
88
    }
89
90
    /**
91
     * @inheritdoc