Code Duplication    Length = 6-6 lines in 2 locations

src/Material.php 2 locations

@@ 117-122 (lines=6) @@
114
    {
115
        /** @var array $materialIds Collection of entity identifiers filtered by additional field */
116
        $materialIds = null;
117
        if (static::idsByFieldValue($query, $fieldID, $fieldValue, $materialIds)) {
118
            // Get material instances
119
            $return = $query->entity(get_called_class())
120
                ->where('MaterialID', $materialIds)
121
                ->exec();
122
        }
123
124
        // If only one argument is passed - return null, otherwise bool
125
        return func_num_args() > 3 ? $return == null : $return;
@@ 174-179 (lines=6) @@
171
        /** @var array $materialIds Collection of entity identifiers filtered by additional field */
172
        $materialIds = null;
173
        if (static::idsByNavigationID($query, $navigationID, $materialIds)) {
174
            if (static::idsByFieldValue($query, $fieldID, $fieldValue, $materialIds, $materialIds)) {
175
                // Get entities by filtered identifiers
176
                $return = $query->entity(get_called_class())
177
                    ->where('MaterialID', $materialIds)
178
                    ->exec();
179
            }
180
        }
181
182
        // If only one argument is passed - return null, otherwise bool