Skip to content

Commit 1b4a733

Browse files
committed
tool visible helper
1 parent 8af1cdb commit 1b4a733

File tree

5 files changed

+15
-15
lines changed

5 files changed

+15
-15
lines changed

src/HandleTools.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ public function bootstrapTools(): array
112112

113113
$guidelines[] = $kitGuidelines;
114114
}
115-
} elseif ($tool->canBeSeen()) {
115+
} elseif ($tool->isVisible()) {
116116
// If the item is a simple tool, add if authorized
117117
$this->toolsBootstrapCache[] = $tool;
118118
}

src/Tools/ProviderTool.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class ProviderTool implements ProviderToolInterface
1313
{
1414
use StaticConstructor;
1515

16-
protected bool $authorized = true;
16+
protected bool $visible = true;
1717

1818
public function __construct(
1919
protected string $type,
@@ -43,15 +43,15 @@ public function setOptions(array $options): self
4343
return $this;
4444
}
4545

46-
public function canSee(bool $allow): ProviderToolInterface
46+
public function visible(bool $allow): ProviderToolInterface
4747
{
48-
$this->authorized = $allow;
48+
$this->visible = $allow;
4949
return $this;
5050
}
5151

52-
public function canBeSeen(): bool
52+
public function isVisible(): bool
5353
{
54-
return $this->authorized;
54+
return $this->visible;
5555
}
5656

5757
public function jsonSerialize(): array

src/Tools/ProviderToolInterface.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public function getName(): ?string;
1414

1515
public function getOptions(): array;
1616

17-
public function canSee(bool $allow): ProviderToolInterface;
17+
public function visible(bool $allow): ProviderToolInterface;
1818

19-
public function canBeSeen(): bool;
19+
public function isVisible(): bool;
2020
}

src/Tools/Tool.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class Tool implements ToolInterface
5858
*/
5959
protected ?int $maxTries = null;
6060

61-
protected bool $authorized = true;
61+
protected bool $visible = true;
6262

6363
/**
6464
* Tool constructor.
@@ -202,15 +202,15 @@ public function setMaxTries(int $tries): self
202202
return $this;
203203
}
204204

205-
public function canSee(bool $allow): ToolInterface
205+
public function visible(bool $visible): ToolInterface
206206
{
207-
$this->authorized = $allow;
207+
$this->visible = $visible;
208208
return $this;
209209
}
210210

211-
public function canBeSeen(): bool
211+
public function isVisible(): bool
212212
{
213-
return $this->authorized;
213+
return $this->visible;
214214
}
215215

216216
/**

src/Tools/ToolInterface.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,9 @@ public function getMaxTries(): ?int;
8080

8181
public function setMaxTries(int $tries): ToolInterface;
8282

83-
public function canSee(bool $allow): ToolInterface;
83+
public function visible(bool $visible): ToolInterface;
8484

85-
public function canBeSeen(): bool;
85+
public function isVisible(): bool;
8686

8787
/**
8888
* Execute the tool's logic with input parameters.

0 commit comments

Comments
 (0)