Skip to content

Commit df85c40

Browse files
patinthehatactions-user
authored andcommitted
Fix styling
1 parent 79c0583 commit df85c40

File tree

10 files changed

+32
-32
lines changed

10 files changed

+32
-32
lines changed

.php_cs.cache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"php":"8.0.3","version":"2.18.3","indent":" ","lineEnding":"\n","rules":{"blank_line_after_namespace":true,"braces":true,"class_definition":true,"constant_case":true,"elseif":true,"function_declaration":true,"indentation_type":true,"line_ending":true,"lowercase_keywords":true,"method_argument_space":{"on_multiline":"ensure_fully_multiline","keep_multiple_spaces_after_comma":true},"no_break_comment":true,"no_closing_tag":true,"no_spaces_after_function_name":true,"no_spaces_inside_parenthesis":true,"no_trailing_whitespace":true,"no_trailing_whitespace_in_comment":true,"single_blank_line_at_eof":true,"single_class_element_per_statement":{"elements":["property"]},"single_import_per_statement":true,"single_line_after_imports":true,"switch_case_semicolon_to_colon":true,"switch_case_space":true,"visibility_required":true,"encoding":true,"full_opening_tag":true,"array_syntax":{"syntax":"short"},"ordered_imports":{"sortAlgorithm":"alpha"},"no_unused_imports":true,"not_operator_with_successor_space":true,"trailing_comma_in_multiline_array":true,"phpdoc_scalar":true,"unary_operator_spaces":true,"binary_operator_spaces":true,"blank_line_before_statement":{"statements":["break","continue","declare","return","throw","try"]},"phpdoc_single_line_var_spacing":true,"phpdoc_var_without_name":true,"class_attributes_separation":{"elements":["method"]},"single_trait_insert_per_statement":true},"hashes":{"src\/HasParentAttributes.php":3530270148,"src\/ExactUrlChecker.php":969602473,"src\/Traits\/HasParentAttributes.php":1912209232,"src\/Traits\/Conditions.php":1203768078,"src\/Traits\/HasHtmlAttributes.php":1687766138,"src\/Traits\/HasTextAttributes.php":1191111029,"src\/Traits\/Activatable.php":3670061697,"src\/Menu.php":4176015359,"src\/Html.php":111642990,"src\/Html\/Tag.php":1399990010,"src\/Html\/Attributes.php":1684799053,"src\/HasHtmlAttributes.php":3901286299,"src\/Link.php":3756908686,"src\/Helpers\/Arr.php":359940572,"src\/Helpers\/Str.php":2008104132,"src\/Helpers\/Reflection.php":333111406,"src\/ActiveUrlChecker.php":1146450297,"src\/Item.php":2602075970,"src\/Activatable.php":3529919562,"tests\/Traits\/ActivatableTest.php":543008871,"tests\/MenuTestCase.php":4004633688,"tests\/MenuBuildTest.php":1557161550,"tests\/TestCase.php":1366220161,"tests\/MenuAddTest.php":83458252,"tests\/MenuSubmenuTest.php":626302525,"tests\/callables.php":2912248239,"tests\/Items\/LinkTest.php":1169217051,"tests\/Items\/FiltersTest.php":457649398,"tests\/Items\/HtmlTest.php":3337821307,"tests\/MenuSetActiveTest.php":240045087,"tests\/MenuExtraHtmlTest.php":7357536}}
1+
{"php":"8.0.3","version":"2.18.3","indent":" ","lineEnding":"\n","rules":{"blank_line_after_namespace":true,"braces":true,"class_definition":true,"constant_case":true,"elseif":true,"function_declaration":true,"indentation_type":true,"line_ending":true,"lowercase_keywords":true,"method_argument_space":{"on_multiline":"ensure_fully_multiline","keep_multiple_spaces_after_comma":true},"no_break_comment":true,"no_closing_tag":true,"no_spaces_after_function_name":true,"no_spaces_inside_parenthesis":true,"no_trailing_whitespace":true,"no_trailing_whitespace_in_comment":true,"single_blank_line_at_eof":true,"single_class_element_per_statement":{"elements":["property"]},"single_import_per_statement":true,"single_line_after_imports":true,"switch_case_semicolon_to_colon":true,"switch_case_space":true,"visibility_required":true,"encoding":true,"full_opening_tag":true,"array_syntax":{"syntax":"short"},"ordered_imports":{"sortAlgorithm":"alpha"},"no_unused_imports":true,"not_operator_with_successor_space":true,"trailing_comma_in_multiline_array":true,"phpdoc_scalar":true,"unary_operator_spaces":true,"binary_operator_spaces":true,"blank_line_before_statement":{"statements":["break","continue","declare","return","throw","try"]},"phpdoc_single_line_var_spacing":true,"phpdoc_var_without_name":true,"class_attributes_separation":{"elements":["method"]},"single_trait_insert_per_statement":true},"hashes":{"src\/HasParentAttributes.php":1717792342,"src\/ExactUrlChecker.php":969602473,"src\/Traits\/HasParentAttributes.php":1231702201,"src\/Traits\/Conditions.php":1534150892,"src\/Traits\/HasHtmlAttributes.php":1057812463,"src\/Traits\/HasTextAttributes.php":1722372727,"src\/Traits\/Activatable.php":3392818246,"src\/Menu.php":2672091354,"src\/Html.php":297278101,"src\/Html\/Tag.php":2768953102,"src\/Html\/Attributes.php":3903326083,"src\/HasHtmlAttributes.php":1584991490,"src\/Link.php":962087492,"src\/Helpers\/Arr.php":2859418294,"src\/Helpers\/Str.php":2008104132,"src\/Helpers\/Reflection.php":1947687630,"src\/ActiveUrlChecker.php":1146450297,"src\/Item.php":2602075970,"src\/Activatable.php":1189996811,"tests\/Traits\/ActivatableTest.php":543008871,"tests\/MenuTestCase.php":4004633688,"tests\/MenuBuildTest.php":1557161550,"tests\/TestCase.php":1366220161,"tests\/MenuAddTest.php":83458252,"tests\/MenuSubmenuTest.php":626302525,"tests\/callables.php":2912248239,"tests\/Items\/LinkTest.php":1169217051,"tests\/Items\/FiltersTest.php":457649398,"tests\/Items\/HtmlTest.php":3337821307,"tests\/MenuSetActiveTest.php":240045087,"tests\/MenuExtraHtmlTest.php":7357536}}

src/Activatable.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44

55
interface Activatable
66
{
7-
public function setActive(bool|callable $active = true): static;
7+
public function setActive(bool | callable $active = true): static;
88

99
public function setInactive(): static;
1010

11-
public function url(): string|null;
11+
public function url(): string | null;
1212

1313
public function hasUrl(): bool;
1414

15-
public function setUrl(string|null $url): static;
15+
public function setUrl(string | null $url): static;
1616

1717
public function determineActiveForUrl(string $url, string $root = '/'): void;
1818
}

src/Helpers/Reflection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class Reflection
1313
/**
1414
* @psalm-suppress UndefinedMethod
1515
*/
16-
public static function firstParameterType(callable|object $callable): string
16+
public static function firstParameterType(callable | object $callable): string
1717
{
1818
$reflection = is_object($callable)
1919
? (new ReflectionObject($callable))->getMethod('__invoke')

src/Html.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class Html implements Item, Activatable, HasParentAttributes
1111
use ActivatableTrait;
1212
use HasParentAttributesTrait;
1313

14-
protected string|null $url = null;
14+
protected string | null $url = null;
1515

1616
protected bool $active = false;
1717

src/Html/Attributes.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public function setAttribute(string $attribute, string $value = ''): self
4646
return $this;
4747
}
4848

49-
public function addClass(string|array $class): self
49+
public function addClass(string | array $class): self
5050
{
5151
if (! is_array($class)) {
5252
$class = [$class];

src/Html/Tag.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ class Tag
66
{
77
public function __construct(
88
public string $tagName,
9-
protected Attributes|null $attributes = null,
9+
protected Attributes | null $attributes = null,
1010
) {
1111
$this->attributes ??= new Attributes();
1212
}

src/Link.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class Link implements Item, HasHtmlAttributes, HasParentAttributes, Activatable
2828
protected Attributes $parentAttributes;
2929

3030
protected function __construct(
31-
protected string|null $url,
31+
protected string | null $url,
3232
protected string $text,
3333
) {
3434
$this->htmlAttributes = new Attributes();

src/Menu.php

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,19 @@ class Menu implements Item, Countable, HasHtmlAttributes, HasParentAttributes, I
2525

2626
protected array $filters = [];
2727

28-
protected string|Item $prepend = '';
28+
protected string | Item $prepend = '';
2929

30-
protected string|Item $append = '';
30+
protected string | Item $append = '';
3131

3232
protected array $wrap = [];
3333

3434
protected string $activeClass = 'active';
3535

3636
protected string $exactActiveClass = 'exact-active';
3737

38-
protected string|null $wrapperTagName = 'ul';
38+
protected string | null $wrapperTagName = 'ul';
3939

40-
protected string|null $parentTagName = 'li';
40+
protected string | null $parentTagName = 'li';
4141

4242
protected bool $activeClassOnParent = true;
4343

@@ -78,7 +78,7 @@ public static function new($items = []): static
7878
*
7979
* @return static
8080
*/
81-
public static function build(array|\Iterator $items, callable $callback, self|null $initial = null): static
81+
public static function build(array | \Iterator $items, callable $callback, self | null $initial = null): static
8282
{
8383
return ($initial ?: static::new())->fill($items, $callback);
8484
}
@@ -93,7 +93,7 @@ public static function build(array|\Iterator $items, callable $callback, self|nu
9393
*
9494
* @return static
9595
*/
96-
public function fill(array|\Iterator $items, callable $callback): self
96+
public function fill(array | \Iterator $items, callable $callback): self
9797
{
9898
$menu = $this;
9999

@@ -131,7 +131,7 @@ public function add(Item $item): self
131131
*
132132
* @return $this
133133
*/
134-
public function addIf(bool|callable $condition, Item $item): self
134+
public function addIf(bool | callable $condition, Item $item): self
135135
{
136136
if ($this->resolveCondition($condition)) {
137137
$this->add($item);
@@ -172,7 +172,7 @@ public function empty(): self
172172
*
173173
* @return $this
174174
*/
175-
public function linkIf(bool|callable $condition, string $url, string $text): self
175+
public function linkIf(bool | callable $condition, string $url, string $text): self
176176
{
177177
if ($this->resolveCondition($condition)) {
178178
$this->link($url, $text);
@@ -203,7 +203,7 @@ public function html(string $html, array $parentAttributes = []): self
203203
*
204204
* @return $this
205205
*/
206-
public function htmlIf(bool|callable $condition, string $html, array $parentAttributes = []): self
206+
public function htmlIf(bool | callable $condition, string $html, array $parentAttributes = []): self
207207
{
208208
if ($this->resolveCondition($condition)) {
209209
$this->html($html, $parentAttributes);
@@ -212,7 +212,7 @@ public function htmlIf(bool|callable $condition, string $html, array $parentAttr
212212
return $this;
213213
}
214214

215-
public function submenu(callable|self|Item|string $header, callable|self|null $menu = null): self
215+
public function submenu(callable | self | Item | string $header, callable | self | null $menu = null): self
216216
{
217217
[$header, $menu] = $this->parseSubmenuArgs(func_get_args());
218218

@@ -221,7 +221,7 @@ public function submenu(callable|self|Item|string $header, callable|self|null $m
221221
return $this->add($menu->prependIf($header, $header));
222222
}
223223

224-
public function submenuIf(bool $condition, callable|self|Item|string $header, callable|self|null $menu = null): self
224+
public function submenuIf(bool $condition, callable | self | Item | string $header, callable | self | null $menu = null): self
225225
{
226226
if ($condition) {
227227
$this->submenu($header, $menu);
@@ -239,7 +239,7 @@ protected function parseSubmenuArgs($args): array
239239
return [$args[0], $args[1]];
240240
}
241241

242-
protected function createSubmenuMenu(self|callable $menu): self
242+
protected function createSubmenuMenu(self | callable $menu): self
243243
{
244244
if (is_callable($menu)) {
245245
$transformer = $menu;
@@ -250,7 +250,7 @@ protected function createSubmenuMenu(self|callable $menu): self
250250
return $menu;
251251
}
252252

253-
protected function createSubmenuHeader(Item|string $header): string
253+
protected function createSubmenuHeader(Item | string $header): string
254254
{
255255
if ($header instanceof Item) {
256256
$header = $header->render();
@@ -399,7 +399,7 @@ public function isExactActive(): bool
399399
*
400400
* @return $this
401401
*/
402-
public function setActive(callable|string $urlOrCallable, string $root = '/'): self
402+
public function setActive(callable | string $urlOrCallable, string $root = '/'): self
403403
{
404404
if (is_string($urlOrCallable)) {
405405
return $this->setActiveFromUrl($urlOrCallable, $root);
@@ -565,7 +565,7 @@ public function setItemParentAttribute(string $attribute, string $value = ''): s
565565
* @param string|null $wrapperTagName
566566
* @return $this
567567
*/
568-
public function setWrapperTag(string|null $wrapperTagName = null): self
568+
public function setWrapperTag(string | null $wrapperTagName = null): self
569569
{
570570
$this->wrapperTagName = $wrapperTagName;
571571

@@ -590,7 +590,7 @@ public function withoutWrapperTag(): self
590590
* @param string|null $parentTagName
591591
* @return $this
592592
*/
593-
public function setParentTag(string|null $parentTagName = null): self
593+
public function setParentTag(string | null $parentTagName = null): self
594594
{
595595
$this->parentTagName = $parentTagName;
596596

src/Traits/Activatable.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public function isActive(): bool
1919
return $this->active;
2020
}
2121

22-
public function setActive(bool|callable $active = true): static
22+
public function setActive(bool | callable $active = true): static
2323
{
2424
if (is_callable($active)) {
2525
$this->active = $active($this);
@@ -39,7 +39,7 @@ public function setInactive(): static
3939
return $this;
4040
}
4141

42-
public function url(): string|null
42+
public function url(): string | null
4343
{
4444
return $this->url;
4545
}
@@ -49,7 +49,7 @@ public function hasUrl(): bool
4949
return ! is_null($this->url);
5050
}
5151

52-
public function setUrl(string|null $url): static
52+
public function setUrl(string | null $url): static
5353
{
5454
$this->url = $url;
5555

src/Traits/HasTextAttributes.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ trait HasTextAttributes
1313
*
1414
* @return $this
1515
*/
16-
public function prepend(string|Item $prepend): self
16+
public function prepend(string | Item $prepend): self
1717
{
1818
$this->prepend = $prepend;
1919

@@ -29,7 +29,7 @@ public function prepend(string|Item $prepend): self
2929
*
3030
* @return $this
3131
*/
32-
public function prependIf(mixed $condition, string|Item $prepend): self
32+
public function prependIf(mixed $condition, string | Item $prepend): self
3333
{
3434
if ($this->resolveCondition($condition)) {
3535
return $this->prepend($prepend);
@@ -45,7 +45,7 @@ public function prependIf(mixed $condition, string|Item $prepend): self
4545
*
4646
* @return $this
4747
*/
48-
public function append(string|Item $append): self
48+
public function append(string | Item $append): self
4949
{
5050
$this->append = $append;
5151

@@ -61,7 +61,7 @@ public function append(string|Item $append): self
6161
*
6262
* @return $this
6363
*/
64-
public function appendIf(bool|callable $condition, string|Item $append): self
64+
public function appendIf(bool | callable $condition, string | Item $append): self
6565
{
6666
if ($this->resolveCondition($condition)) {
6767
return $this->append($append);

0 commit comments

Comments
 (0)