GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

Code Duplication    Length = 6-9 lines in 2 locations

src/Document/DbRefRelationManager.php 1 location

@@ 223-231 (lines=9) @@
220
221
        switch ($relationType) {
222
223
            case Document::RELATION_BELONGS:
224
                if (!$document->isStored()) {
225
                    throw new \Sokil\Mongo\Exception(
226
                        'Document '.get_class($document).' must be saved before adding relation'
227
                    );
228
                }
229
                $documentDbRef = self::generateDbRef($document);
230
                $this->document->set($field, $documentDbRef);
231
                break;
232
233
            case Document::RELATION_HAS_ONE;
234
                if (!$this->document->isStored()) {

src/Document/RelationManager.php 1 location

@@ 181-186 (lines=6) @@
178
179
        switch ($relationType) {
180
181
            case Document::RELATION_BELONGS:
182
                if (!$document->isStored()) {
183
                    throw new \Sokil\Mongo\Exception('Document ' . get_class($document) . ' must be saved before adding relation');
184
                }
185
                $this->document->set($field, $document->getId());
186
                break;
187
188
            case Document::RELATION_HAS_ONE;
189
                if (!$this->document->isStored()) {