Code Duplication    Length = 15-16 lines in 2 locations

src/reflection/GenericMethodAction.php 1 location

@@ 17-31 (lines=15) @@
14
     * @param TypeFactory $types
15
     * @param CommentParser $parser
16
     */
17
    public function __construct($object, $method, TypeFactory $types, CommentParser $parser) {
18
        parent::__construct($object, $method, $types, $parser);
19
        $this->generic = new GenericAction($this);
20
        $this->generic
21
            ->setCaption(parent::caption())
22
            ->setDescription(parent::description())
23
            ->setParameters(parent::parameters())
24
            ->setModifying(parent::isModifying())
25
            ->setExecute(function ($parameters) {
26
                return parent::execute($parameters);
27
            })
28
            ->setFill(function ($parameters) {
29
                return $parameters;
30
            });
31
    }
32
33
    public function generic() {
34
        return $this->generic;

src/reflection/GenericObjectAction.php 1 location

@@ 14-29 (lines=16) @@
11
    /** @var GenericAction */
12
    private $generic;
13
14
    public function __construct($class, TypeFactory $types, CommentParser $parser, callable $execute) {
15
        parent::__construct($class, $types, $parser);
16
        $this->execute = $execute;
17
        $this->generic = new GenericAction($this);
18
        $this->generic
19
            ->setCaption(parent::caption())
20
            ->setDescription(parent::description())
21
            ->setParameters(parent::parameters())
22
            ->setModifying(parent::isModifying())
23
            ->setExecute(function ($parameters) {
24
                return parent::execute($parameters);
25
            })
26
            ->setFill(function ($parameters) {
27
                return $parameters;
28
            });
29
    }
30
31
    public function generic() {
32
        return $this->generic;