Code Duplication    Length = 12-14 lines in 2 locations

src/Relations/AbstractRelation.php 2 locations

@@ 85-98 (lines=14) @@
82
     *
83
     * @return $this
84
     */
85
    public function cascade(array $cascade)
86
    {
87
        foreach ($cascade as $name) {
88
            $method = 'cascade' . Inflector::classify(strtolower($name));
89
90
            if (!method_exists($this->association, $method)) {
91
                throw new InvalidArgumentException('Cascade [' . $name . '] does not exist');
92
            }
93
94
            $this->{$method}();
95
        }
96
97
        return $this;
98
    }
99
100
    /**
101
     * @param string $strategy one of "LAZY", "EAGER", "EXTRA_LAZY"
@@ 105-116 (lines=12) @@
102
     *
103
     * @return $this
104
     */
105
    public function fetch($strategy)
106
    {
107
        $method = 'fetch' . Inflector::classify(strtolower($strategy));
108
109
        if (!method_exists($this->association, $method)) {
110
            throw new InvalidArgumentException('Fetch [' . $strategy . '] does not exist');
111
        }
112
113
        $this->{$method}();
114
115
        return $this;
116
    }
117
118
    /**
119
     * @return ClassMetadataBuilder