File tree Expand file tree Collapse file tree 4 files changed +84
-45
lines changed Expand file tree Collapse file tree 4 files changed +84
-45
lines changed Original file line number Diff line number Diff line change 66 colors=" true"
77 processIsolation=" false"
88 stopOnFailure=" false"
9- xsi:noNamespaceSchemaLocation=" https://schema.phpunit.de/10.0/phpunit.xsd"
10- backupStaticProperties=" false" >
11- <coverage >
12- <include >
13- <directory suffix =" .php" >./src/</directory >
14- </include >
15- <exclude >
16- <directory >vendor/</directory >
17- </exclude >
18- </coverage >
9+ xsi:noNamespaceSchemaLocation=" https://schema.phpunit.de/10.1/phpunit.xsd" backupStaticProperties =" false" >
10+ <coverage />
1911 <testsuites >
2012 <testsuite name =" base" >
2113 <directory suffix =" Test.php" >./tests/</directory >
2517 <ini name =" display_errors" value =" On" />
2618 <ini name =" display_startup_errors" value =" On" />
2719 </php >
20+ <source >
21+ <include >
22+ <directory suffix =" .php" >./src/</directory >
23+ </include >
24+ <exclude >
25+ <directory >vendor/</directory >
26+ </exclude >
27+ </source >
2828</phpunit >
Original file line number Diff line number Diff line change 1+ <?php
2+ declare (strict_types=1 );
3+
4+ namespace Eightfold \HTMLBuilder \Components ;
5+
6+ use Stringable ;
7+
8+ use Eightfold \HTMLBuilder \Element ;
9+
10+ class PageTitle implements Stringable
11+ {
12+ /**
13+ * @param string[] $titles
14+ */
15+ public static function create (array $ titles , string $ separator = ' | ' ): self
16+ {
17+ return new self ($ titles , $ separator );
18+ }
19+
20+ /**
21+ * @param string[] $titles
22+ */
23+ final private function __construct (
24+ private array $ titles ,
25+ private readonly string $ separator
26+ ) {
27+ }
28+
29+ public function __toString (): string
30+ {
31+ return (string ) Element::title (
32+ implode ($ this ->separator , $ this ->titles )
33+ );
34+ }
35+ }
Original file line number Diff line number Diff line change @@ -125,7 +125,7 @@ private function selectDropdown(): Element
125125 {
126126 $ elements = [];
127127 foreach ($ this ->options as $ value => $ content ) {
128- $ value = strval ( $ value) ;
128+ $ value = ( string ) $ value ;
129129 $ option = Element::option ($ content )->props ('value ' . $ value );
130130 if ($ this ->isSelected ($ value )) {
131131 $ option = $ option ->prop ('selected selected ' );
@@ -151,7 +151,7 @@ private function selectOther(): Element
151151 $ type = 'checkbox ' ;
152152 }
153153 foreach ($ this ->options as $ value => $ content ) {
154- $ value = strval ( $ value) ;
154+ $ value = ( string ) $ value ;
155155 $ id = $ this ->name . '- ' . $ value ;
156156 $ label = Element::label ($ content )->props ('for ' . $ id );
157157 $ input = Element::input ()->omitEndTag ()->props (
You can’t perform that action at this time.
0 commit comments