Code Duplication    Length = 16-16 lines in 2 locations

src/Collection/LazyModelCollection.php 1 location

@@ 67-82 (lines=16) @@
64
     * @param string            $foreignId
65
     * @param array|null        $orderBy
66
     */
67
    public function __construct(
68
        ResolverInterface $resolver,
69
        string $modelClass,
70
        string $foreignField,
71
        string $foreignId,
72
        array $orderBy = null
73
    ) {
74
        $this->resolver = $resolver;
75
        $this->modelClass = $modelClass;
76
        $this->foreignField = $foreignField;
77
        $this->foreignId = $foreignId;
78
        $this->orderBy = $orderBy;
79
80
        $this->propertyReflection = new \ReflectionProperty($this->modelClass, $this->foreignField);
81
        $this->propertyReflection->setAccessible(true);
82
    }
83
84
    private function resolveModels()
85
    {

src/Collection/ModelCollection.php 1 location

@@ 50-65 (lines=16) @@
47
     * @param string     $foreignId
48
     * @param array|null $orderBy
49
     */
50
    public function __construct(
51
        string $modelClass,
52
        string $foreignField,
53
        string $foreignId,
54
        array $orderBy = null
55
    ) {
56
        $this->modelClass = $modelClass;
57
        $this->foreignField = $foreignField;
58
        $this->foreignId = $foreignId;
59
        $this->orderBy = $orderBy;
60
61
        $this->models = [];
62
63
        $this->propertyReflection = new \ReflectionProperty($this->modelClass, $this->foreignField);
64
        $this->propertyReflection->setAccessible(true);
65
    }
66
67
    /**
68
     * @param ModelInterface $model