Remove usage of search() === to contains()

This commit is contained in:
Deon George 2025-01-16 12:20:22 +11:00
parent 960e0de5c8
commit 293f1ab9ce
5 changed files with 8 additions and 8 deletions

View File

@ -36,7 +36,7 @@ final class ObjectClass extends Attribute
*/
public function isStructural(string $value): bool
{
return $this->structural->search($value) !== FALSE;
return $this->structural->contains($value);
}
public function render(bool $edit=FALSE,bool $old=FALSE,bool $new=FALSE): View

View File

@ -324,7 +324,7 @@ final class AttributeType extends Base {
*/
public function addRequiredByObjectClass(string $name): void
{
if ($this->required_by_object_classes->search($name) === FALSE)
if (! $this->required_by_object_classes->contains($name))
$this->required_by_object_classes->push($name);
}
@ -336,7 +336,7 @@ final class AttributeType extends Base {
*/
public function addUsedInObjectClass(string $name): void
{
if ($this->used_in_object_classes->search($name) === FALSE)
if (! $this->used_in_object_classes->contains($name))
$this->used_in_object_classes->push($name);
}

View File

@ -115,7 +115,7 @@ final class MatchingRule extends Base {
{
$name = trim($name);
if ($this->used_by_attrs->search($name) === FALSE)
if (! $this->used_by_attrs->contains($name))
$this->used_by_attrs->push($name);
}

View File

@ -241,7 +241,7 @@ final class ObjectClass extends Base
*/
public function addChildObjectClass(string $name): void
{
if (! $this->child_objectclasses->has($name))
if (! $this->child_objectclasses->contains($name))
$this->child_objectclasses->push($name);
}

View File

@ -27,7 +27,7 @@
<div tabindex="-1" role="menu" aria-hidden="true" class="dropdown-menu dropdown-menu-right">
<ul class="nav flex-column">
@if ((isset($page_actions) && ($page_actions->search('edit') !== FALSE)) || old())
@if ((isset($page_actions) && $page_actions->contains('edit')) || old())
<li class="nav-item">
<span class="nav-link pt-0 pb-1">
<button id="entry-edit" class="p-2 m-0 border-0 btn-transition btn btn-outline-dark w-100 text-start">
@ -37,7 +37,7 @@
</li>
@endif
@if (isset($page_actions) && ($page_actions->search('export') !== FALSE))
@if (isset($page_actions) && $page_actions->contains('export'))
<li class="nav-item">
<a class="nav-link pt-0 pb-1">
<button type="button" class="p-2 m-0 border-0 btn-transition btn btn-outline-dark w-100 text-start" data-bs-toggle="modal" data-bs-target="#entry-export-modal" {{--data-bs-whatever="ldif"--}}>
@ -47,7 +47,7 @@
</li>
@endif
@if (isset($page_actions) && ($page_actions->search('copy') !== FALSE))
@if (isset($page_actions) && $page_actions->contains('copy'))
<li class="nav-item">
<a class="nav-link pt-0 pb-1">
<button class="p-2 m-0 border-0 btn-transition btn btn-outline-dark w-100 text-start">