Code Duplication    Length = 13-13 lines in 2 locations

src/Field/FieldCollection.php 2 locations

@@ 60-72 (lines=13) @@
57
     * @param  StreamInterface $stream
58
     * @return FieldCollection
59
     */
60
    public function assignedTo(StreamInterface $stream)
61
    {
62
        $fieldSlugs = $stream->getAssignmentFieldSlugs();
63
64
        return new static(
65
            array_filter(
66
                $this->items,
67
                function (FieldInterface $field) use ($fieldSlugs) {
68
                    return in_array($field->getSlug(), $fieldSlugs);
69
                }
70
            )
71
        );
72
    }
73
74
    /**
75
     * Return fields only NOT assigned
@@ 81-93 (lines=13) @@
78
     * @param  StreamInterface $stream
79
     * @return FieldCollection
80
     */
81
    public function notAssignedTo(StreamInterface $stream)
82
    {
83
        $fieldSlugs = $stream->getAssignmentFieldSlugs();
84
85
        return new static(
86
            array_filter(
87
                $this->items,
88
                function (FieldInterface $field) use ($fieldSlugs) {
89
                    return !in_array($field->getSlug(), $fieldSlugs);
90
                }
91
            )
92
        );
93
    }
94
95
    /**
96
     * Return only unlocked fields.