Code Duplication    Length = 3-3 lines in 4 locations

src/Query/LaravelReadQuery.php 4 locations

@@ 63-65 (lines=3) @@
60
        }
61
62
        $checkInstance = $sourceEntityInstance instanceof Model ? $sourceEntityInstance : null;
63
        if (!$this->getAuth()->canAuth(ActionVerb::READ(), get_class($sourceEntityInstance), $checkInstance)) {
64
            throw new ODataException("Access denied", 403);
65
        }
66
67
        $result          = new QueryResult();
68
        $result->results = null;
@@ 196-198 (lines=3) @@
193
        assert(null != $sourceEntityInstance, "Source instance must not be null");
194
        $this->checkSourceInstance($sourceEntityInstance);
195
196
        if (!$this->getAuth()->canAuth(ActionVerb::READ(), get_class($sourceEntityInstance), $sourceEntityInstance)) {
197
            throw new ODataException("Access denied", 403);
198
        }
199
200
        $propertyName = $targetProperty->getName();
201
        $results = $sourceEntityInstance->$propertyName();
@@ 255-257 (lines=3) @@
252
            $sourceEntityInstance = $this->getSourceEntityInstance($resourceSet);
253
        }
254
255
        if (!$this->getAuth()->canAuth(ActionVerb::READ(), get_class($sourceEntityInstance), $sourceEntityInstance)) {
256
            throw new ODataException("Access denied", 403);
257
        }
258
259
        if ($keyDescriptor) {
260
            foreach ($keyDescriptor->getValidatedNamedValues() as $key => $value) {
@@ 295-297 (lines=3) @@
292
        }
293
        $this->checkSourceInstance($sourceEntityInstance);
294
295
        if (!$this->getAuth()->canAuth(ActionVerb::READ(), get_class($sourceEntityInstance), $sourceEntityInstance)) {
296
            throw new ODataException("Access denied", 403);
297
        }
298
299
        $propertyName = $targetProperty->getName();
300
        return $sourceEntityInstance->$propertyName;