Skip to content

Commit 4c832ce

Browse files
committed
Simplify the contains method
1 parent c1ac782 commit 4c832ce

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

src/Attribute.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -170,12 +170,7 @@ public function merge(array $values, bool $strict = false): Attribute {
170170
* @return bool
171171
*/
172172
public function contains($value): bool {
173-
foreach ($this->values as $v) {
174-
if ($v === $value) {
175-
return true;
176-
}
177-
}
178-
return false;
173+
return in_array($value, $this->values, true);
179174
}
180175

181176
/**

0 commit comments

Comments
 (0)