Code Duplication    Length = 13-13 lines in 2 locations

src/InMemoryDiscovery.php 2 locations

@@ 141-153 (lines=13) @@
138
    /**
139
     * {@inheritdoc}
140
     */
141
    public function removeBinding(Uuid $uuid)
142
    {
143
        $uuidString = $uuid->toString();
144
145
        if (!isset($this->bindings[$uuidString])) {
146
            return;
147
        }
148
149
        $binding = $this->bindings[$uuidString];
150
151
        unset($this->bindings[$uuidString]);
152
        unset($this->bindingsByTypeName[$binding->getTypeName()][$uuidString]);
153
    }
154
155
    /**
156
     * {@inheritdoc}
@@ 244-256 (lines=13) @@
241
    /**
242
     * {@inheritdoc}
243
     */
244
    protected function removeBindingsWithTypeNameThatMatch($typeName, Expression $expr)
245
    {
246
        if (!isset($this->bindingsByTypeName[$typeName])) {
247
            return;
248
        }
249
250
        foreach ($this->bindingsByTypeName[$typeName] as $uuidString => $binding) {
251
            if ($expr->evaluate($binding)) {
252
                unset($this->bindings[$uuidString]);
253
                unset($this->bindingsByTypeName[$typeName][$uuidString]);
254
            }
255
        }
256
    }
257
258
    /**
259
     * {@inheritdoc}