Code Duplication    Length = 11-11 lines in 2 locations

src/LabelCollection.php 2 locations

@@ 52-62 (lines=11) @@
49
     * @param Label $label
50
     * @return LabelCollection
51
     */
52
    public function without(Label $label)
53
    {
54
        $labels = array_filter(
55
            $this->labels,
56
            function (Label $existingLabel) use ($label) {
57
                return !$existingLabel->equals($label);
58
            }
59
        );
60
61
        return new LabelCollection($labels);
62
    }
63
64
    /**
65
     * @inheritdoc
@@ 76-86 (lines=11) @@
73
     * @param Label $label
74
     * @return bool
75
     */
76
    public function contains(Label $label)
77
    {
78
        $equalLabels = array_filter(
79
            $this->labels,
80
            function (Label $existingLabel) use ($label) {
81
                return $label->equals($existingLabel);
82
            }
83
        );
84
85
        return !empty($equalLabels);
86
    }
87
88
    /**
89
     * @return Label[]