@@ -63,10 +63,10 @@ public function script(string $url, array $attributes = [], bool $secure = null)
63
63
/**
64
64
* Transform the string to an Html serializable object
65
65
*
66
- * @param $html
66
+ * @param string $html
67
67
* @return \Illuminate\Support\HtmlString
68
68
*/
69
- protected function toHtmlString ($ html ): HtmlString
69
+ protected function toHtmlString (string $ html ): HtmlString
70
70
{
71
71
return new HtmlString ($ html );
72
72
}
@@ -97,9 +97,9 @@ public function attributes(array $attributes): string
97
97
*
98
98
* @param string $key
99
99
* @param mixed $value
100
- * @return string
100
+ * @return mixed
101
101
*/
102
- protected function attributeElement (string $ key , mixed $ value ): string
102
+ protected function attributeElement (string $ key , mixed $ value ): mixed
103
103
{
104
104
// For numeric keys we will assume that the value is a boolean attribute
105
105
// where the presence of the attribute represents a true value and the
@@ -120,10 +120,10 @@ protected function attributeElement(string $key, mixed $value): string
120
120
}
121
121
122
122
if (! is_null ($ value )) {
123
- return $ key .'=" ' .e ($ value , false ).'" ' ;
123
+ return $ key .'=" ' .e (strval ( $ value) , false ).'" ' ;
124
124
}
125
125
126
- return '' ;
126
+ return null ;
127
127
}
128
128
129
129
/**
@@ -458,7 +458,7 @@ protected function listingElement(mixed $key, string $type, mixed $value): HtmlS
458
458
if (is_array ($ value )) {
459
459
return $ this ->nestedListing ($ key , $ type , $ value );
460
460
} else {
461
- return '<li> ' .e ($ value , false ).'</li> ' ;
461
+ return '<li> ' .e (strval ( $ value) , false ).'</li> ' ;
462
462
}
463
463
}
464
464
@@ -467,10 +467,10 @@ protected function listingElement(mixed $key, string $type, mixed $value): HtmlS
467
467
*
468
468
* @param mixed $key
469
469
* @param string $type
470
- * @param mixed $value
470
+ * @param array $value
471
471
* @return \Illuminate\Support\HtmlString|string
472
472
*/
473
- protected function nestedListing (mixed $ key , string $ type , mixed $ value ): HtmlString |string
473
+ protected function nestedListing (mixed $ key , string $ type , array $ value ): HtmlString |string
474
474
{
475
475
if (is_int ($ key )) {
476
476
return $ this ->listing ($ type , $ value );
@@ -548,6 +548,6 @@ public function tag(string $tag, mixed $content, array $attributes = []): HtmlSt
548
548
{
549
549
$ content = is_array ($ content ) ? implode ('' , $ content ) : $ content ;
550
550
551
- return $ this ->toHtmlString ('< ' .$ tag .$ this ->attributes ($ attributes ).'> ' .$ this ->toHtmlString ($ content ).'</ ' .$ tag .'> ' );
551
+ return $ this ->toHtmlString ('< ' .$ tag .$ this ->attributes ($ attributes ).'> ' .$ this ->toHtmlString (strval ( $ content) ).'</ ' .$ tag .'> ' );
552
552
}
553
553
}
0 commit comments