Code Duplication    Length = 15-15 lines in 2 locations

src/Reflection/Getter.php 1 location

@@ 123-137 (lines=15) @@
120
     * @param string $field
121
     * @return null|\ReflectionProperty
122
     */
123
    protected function findProperty(ReflectionClass $reflectionClass, string $field)
124
    {
125
        if ($reflectionClass->hasProperty($field)) {
126
            $property = $reflectionClass->getProperty($field);
127
            if (!$property->isStatic()) {
128
                if ($property->isPublic()) {
129
                    return $property;
130
                } else if ($this->ignoreProtected) {
131
                    $property->setAccessible(true);
132
                    return $property;
133
                }
134
            }
135
        }
136
        return null;
137
    }
138
}
139

src/Reflection/Setter.php 1 location

@@ 106-120 (lines=15) @@
103
     * @param string $field
104
     * @return null|\ReflectionProperty
105
     */
106
    protected function findProperty(ReflectionClass $reflectionClass, string $field)
107
    {
108
        if ($reflectionClass->hasProperty($field)) {
109
            $property = $reflectionClass->getProperty($field);
110
            if (!$property->isStatic()) {
111
                if ($property->isPublic()) {
112
                    return $property;
113
                } else if ($this->ignoreProtected) {
114
                    $property->setAccessible(true);
115
                    return $property;
116
                }
117
            }
118
        }
119
        return null;
120
    }
121
}
122