Code Duplication    Length = 11-11 lines in 2 locations

eZ/Publish/API/Repository/Values/Content/Query/Criterion/Sibling.php 1 location

@@ 18-28 (lines=11) @@
15
 */
16
class Sibling extends AggregateCriterion
17
{
18
    public function __construct(int $id, int $parentLocationId)
19
    {
20
        $criteria = new LogicalAnd([
21
            new ParentLocationId($parentLocationId),
22
            new LogicalNot(
23
                new LocationId($id)
24
            ),
25
        ]);
26
27
        parent::__construct($criteria);
28
    }
29
30
    public static function fromLocation(Location $location): self
31
    {

eZ/Publish/Core/Search/Legacy/Content/Common/Gateway/CriterionHandler/Sibling.php 1 location

@@ 18-28 (lines=11) @@
15
 */
16
class Sibling extends AggregateCriterion
17
{
18
    public function __construct(Location $location)
19
    {
20
        $criteria = new LogicalAnd([
21
            new ParentLocationId($location->parentLocationId),
22
            new LogicalNot(
23
                new LocationId($location->id)
24
            ),
25
        ]);
26
27
        parent::__construct($criteria);
28
    }
29
}
30