From e9021bdedcf04fb7790611a60f6a7a86294b17e7 Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Sat, 18 Mar 2023 14:41:35 -0400 Subject: [PATCH 1/4] refactor: Cast instead of strval() --- src/Forms/Select.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Forms/Select.php b/src/Forms/Select.php index 14f48d6..c42c1bc 100644 --- a/src/Forms/Select.php +++ b/src/Forms/Select.php @@ -125,7 +125,7 @@ private function selectDropdown(): Element { $elements = []; foreach ($this->options as $value => $content) { - $value = strval($value); + $value = (string) $value; $option = Element::option($content)->props('value ' . $value); if ($this->isSelected($value)) { $option = $option->prop('selected selected'); @@ -151,7 +151,7 @@ private function selectOther(): Element $type = 'checkbox'; } foreach ($this->options as $value => $content) { - $value = strval($value); + $value = (string) $value; $id = $this->name . '-' . $value; $label = Element::label($content)->props('for ' . $id); $input = Element::input()->omitEndTag()->props( From bf1632ab8afd208a3a1b4ba580005198491fdde7 Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Fri, 21 Apr 2023 18:37:09 -0400 Subject: [PATCH 2/4] add: Page title --- src/Components/PageTitle.php | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 src/Components/PageTitle.php diff --git a/src/Components/PageTitle.php b/src/Components/PageTitle.php new file mode 100644 index 0000000..bcd2b05 --- /dev/null +++ b/src/Components/PageTitle.php @@ -0,0 +1,29 @@ + Date: Fri, 21 Apr 2023 18:42:41 -0400 Subject: [PATCH 3/4] update: Dependencies --- composer.lock | 70 +++++++++++++++++++++++++++------------------------ phpunit.xml | 20 +++++++-------- 2 files changed, 47 insertions(+), 43 deletions(-) diff --git a/composer.lock b/composer.lock index 654826d..23e8279 100644 --- a/composer.lock +++ b/composer.lock @@ -291,16 +291,16 @@ }, { "name": "phpstan/phpstan", - "version": "1.10.7", + "version": "1.10.14", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "b10ceb526d9607903c5b2673f1fc8775dbe48975" + "reference": "d232901b09e67538e5c86a724be841bea5768a7c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/b10ceb526d9607903c5b2673f1fc8775dbe48975", - "reference": "b10ceb526d9607903c5b2673f1fc8775dbe48975", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/d232901b09e67538e5c86a724be841bea5768a7c", + "reference": "d232901b09e67538e5c86a724be841bea5768a7c", "shasum": "" }, "require": { @@ -349,20 +349,20 @@ "type": "tidelift" } ], - "time": "2023-03-16T15:24:20+00:00" + "time": "2023-04-19T13:47:27+00:00" }, { "name": "phpunit/php-code-coverage", - "version": "10.0.2", + "version": "10.1.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "20800e84296ea4732f9a125e08ce86b4004ae3e4" + "reference": "884a0da7f9f46f28b2cb69134217fd810b793974" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/20800e84296ea4732f9a125e08ce86b4004ae3e4", - "reference": "20800e84296ea4732f9a125e08ce86b4004ae3e4", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/884a0da7f9f46f28b2cb69134217fd810b793974", + "reference": "884a0da7f9f46f28b2cb69134217fd810b793974", "shasum": "" }, "require": { @@ -381,7 +381,7 @@ "theseer/tokenizer": "^1.2.0" }, "require-dev": { - "phpunit/phpunit": "^10.0" + "phpunit/phpunit": "^10.1" }, "suggest": { "ext-pcov": "PHP extension that provides line coverage", @@ -390,7 +390,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "10.0-dev" + "dev-main": "10.1-dev" } }, "autoload": { @@ -418,7 +418,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/10.0.2" + "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/10.1.1" }, "funding": [ { @@ -426,7 +427,7 @@ "type": "github" } ], - "time": "2023-03-06T13:00:19+00:00" + "time": "2023-04-17T12:15:40+00:00" }, { "name": "phpunit/php-file-iterator", @@ -671,16 +672,16 @@ }, { "name": "phpunit/phpunit", - "version": "10.0.16", + "version": "10.1.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "07d386a11ac7094032900f07cada1c8975d16607" + "reference": "0d9401b7e8245d71079e249e3cb868e9d2337887" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/07d386a11ac7094032900f07cada1c8975d16607", - "reference": "07d386a11ac7094032900f07cada1c8975d16607", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/0d9401b7e8245d71079e249e3cb868e9d2337887", + "reference": "0d9401b7e8245d71079e249e3cb868e9d2337887", "shasum": "" }, "require": { @@ -694,7 +695,7 @@ "phar-io/manifest": "^2.0.3", "phar-io/version": "^3.0.2", "php": ">=8.1", - "phpunit/php-code-coverage": "^10.0", + "phpunit/php-code-coverage": "^10.1.1", "phpunit/php-file-iterator": "^4.0", "phpunit/php-invoker": "^4.0", "phpunit/php-text-template": "^3.0", @@ -720,7 +721,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "10.0-dev" + "dev-main": "10.1-dev" } }, "autoload": { @@ -751,7 +752,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/10.0.16" + "security": "https://github.com/sebastianbergmann/phpunit/security/policy", + "source": "https://github.com/sebastianbergmann/phpunit/tree/10.1.1" }, "funding": [ { @@ -767,7 +769,7 @@ "type": "tidelift" } ], - "time": "2023-03-13T09:02:40+00:00" + "time": "2023-04-17T12:17:05+00:00" }, { "name": "sebastian/cli-parser", @@ -1071,16 +1073,16 @@ }, { "name": "sebastian/diff", - "version": "5.0.0", + "version": "5.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "70dd1b20bc198da394ad542e988381b44e64e39f" + "reference": "aae9a0a43bff37bd5d8d0311426c87bf36153f02" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/70dd1b20bc198da394ad542e988381b44e64e39f", - "reference": "70dd1b20bc198da394ad542e988381b44e64e39f", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/aae9a0a43bff37bd5d8d0311426c87bf36153f02", + "reference": "aae9a0a43bff37bd5d8d0311426c87bf36153f02", "shasum": "" }, "require": { @@ -1125,7 +1127,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/diff/issues", - "source": "https://github.com/sebastianbergmann/diff/tree/5.0.0" + "security": "https://github.com/sebastianbergmann/diff/security/policy", + "source": "https://github.com/sebastianbergmann/diff/tree/5.0.1" }, "funding": [ { @@ -1133,20 +1136,20 @@ "type": "github" } ], - "time": "2023-02-03T07:00:31+00:00" + "time": "2023-03-23T05:12:41+00:00" }, { "name": "sebastian/environment", - "version": "6.0.0", + "version": "6.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "b6f3694c6386c7959915a0037652e0c40f6f69cc" + "reference": "43c751b41d74f96cbbd4e07b7aec9675651e2951" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/b6f3694c6386c7959915a0037652e0c40f6f69cc", - "reference": "b6f3694c6386c7959915a0037652e0c40f6f69cc", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/43c751b41d74f96cbbd4e07b7aec9675651e2951", + "reference": "43c751b41d74f96cbbd4e07b7aec9675651e2951", "shasum": "" }, "require": { @@ -1188,7 +1191,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/environment/issues", - "source": "https://github.com/sebastianbergmann/environment/tree/6.0.0" + "security": "https://github.com/sebastianbergmann/environment/security/policy", + "source": "https://github.com/sebastianbergmann/environment/tree/6.0.1" }, "funding": [ { @@ -1196,7 +1200,7 @@ "type": "github" } ], - "time": "2023-02-03T07:03:04+00:00" + "time": "2023-04-11T05:39:26+00:00" }, { "name": "sebastian/exporter", diff --git a/phpunit.xml b/phpunit.xml index 3d19a5e..4feb0b5 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -6,16 +6,8 @@ colors="true" processIsolation="false" stopOnFailure="false" - xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.0/phpunit.xsd" - backupStaticProperties="false"> - - - ./src/ - - - vendor/ - - + xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.1/phpunit.xsd" backupStaticProperties="false"> + ./tests/ @@ -25,4 +17,12 @@ + + + ./src/ + + + vendor/ + + From c3f6aa4cbdc8553f0007091f7141bed206228b66 Mon Sep 17 00:00:00 2001 From: Josh Bruce Date: Fri, 21 Apr 2023 18:42:51 -0400 Subject: [PATCH 4/4] fix: Page titles --- src/Components/PageTitle.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Components/PageTitle.php b/src/Components/PageTitle.php index bcd2b05..1e42a42 100644 --- a/src/Components/PageTitle.php +++ b/src/Components/PageTitle.php @@ -9,11 +9,17 @@ class PageTitle implements Stringable { + /** + * @param string[] $titles + */ public static function create(array $titles, string $separator = ' | '): self { - return new self($title, $separator); + return new self($titles, $separator); } + /** + * @param string[] $titles + */ final private function __construct( private array $titles, private readonly string $separator @@ -23,7 +29,7 @@ final private function __construct( public function __toString(): string { return (string) Element::title( - implode($separator, $titles) + implode($this->separator, $this->titles) ); } }