Code Duplication    Length = 20-20 lines in 2 locations

src/RunOpenCode/ExchangeRate/Repository/FileRepository.php 1 location

@@ 169-188 (lines=20) @@
166
    /**
167
     * {@inheritdoc}
168
     */
169
    public function all(array $criteria = array())
170
    {
171
        if (count($criteria) == 0) {
172
            return $this->rates;
173
        }
174
175
        $result = array();
176
177
        /**
178
         * @var RateInterface $rate
179
         */
180
        foreach ($this->rates as $rate) {
181
182
            if (RateFilterUtil::matches($rate, $criteria)) {
183
                $result[] = $rate;
184
            }
185
        }
186
187
        return $this->paginate($result, $criteria);
188
    }
189
190
    /**
191
     * {@inheritdoc}

src/RunOpenCode/ExchangeRate/Repository/MemoryRepository.php 1 location

@@ 126-145 (lines=20) @@
123
    /**
124
     * {@inheritdoc}
125
     */
126
    public function all(array $criteria = array())
127
    {
128
        if (count($criteria) == 0) {
129
            return $this->rates;
130
        }
131
132
        $result = array();
133
134
        /**
135
         * @var RateInterface $rate
136
         */
137
        foreach ($this->rates as $rate) {
138
139
            if (RateFilterUtil::matches($rate, $criteria)) {
140
                $result[] = $rate;
141
            }
142
        }
143
144
        return $this->paginate($result, $criteria);
145
    }
146
147
    /**
148
     * {@inheritdoc}