35
35
* @copyright Copyright (c) 2016-2024 Jorge Patricio Castro Castillo MIT License.
36
36
* Don't delete this comment, its part of the license.
37
37
* Part of this code is based in the work of Laravel PHP Components.
38
- * @version 4.16
38
+ * @version 4.17
39
39
* @link https://github.com/EFTEC/BladeOne
40
40
*/
41
41
class BladeOne
42
42
{
43
43
//<editor-fold desc="fields">
44
- public const VERSION = '4.16 ' ;
44
+ public const VERSION = '4.17 ' ;
45
45
/** @var int BladeOne reads if the compiled file has changed. If it has changed,then the file is replaced. */
46
46
public const MODE_AUTO = 0 ;
47
47
/** @var int Then compiled file is always replaced. It's slow and it's useful for development. */
@@ -1098,7 +1098,7 @@ public function splitForeach($each = 1, $splitText = ',', $splitEnd = ''): strin
1098
1098
* @param mixed $default
1099
1099
* @return mixed
1100
1100
*/
1101
- public static function last ($ array , callable $ callback = null , $ default = null )
1101
+ public static function last ($ array , ? callable $ callback = null , $ default = null )
1102
1102
{
1103
1103
if (\is_null ($ callback )) {
1104
1104
return empty ($ array ) ? static ::value ($ default ) : \end ($ array );
@@ -1125,7 +1125,7 @@ public static function value($value)
1125
1125
* @param mixed $default
1126
1126
* @return mixed
1127
1127
*/
1128
- public static function first ($ array , callable $ callback = null , $ default = null )
1128
+ public static function first ($ array , ? callable $ callback = null , $ default = null )
1129
1129
{
1130
1130
if (\is_null ($ callback )) {
1131
1131
return empty ($ array ) ? static ::value ($ default ) : \reset ($ array );
@@ -1438,6 +1438,7 @@ public function getCompiledFile($templateName = ''): string
1438
1438
* Get the mode of the engine.See BladeOne::MODE_* constants
1439
1439
*
1440
1440
* @return int=[self::MODE_AUTO,self::MODE_DEBUG,self::MODE_FAST,self::MODE_SLOW][$i]
1441
+ * @noinspection PhpUndefinedConstantInspection
1441
1442
*/
1442
1443
public function getMode (): int
1443
1444
{
@@ -1668,7 +1669,7 @@ public function convertArg($array): string
1668
1669
if (!\is_array ($ array )) {
1669
1670
return $ array ; // nothing to convert.
1670
1671
}
1671
- return \implode (' ' , \array_map ('static ::convertArgCallBack ' , \array_keys ($ array ), $ array ));
1672
+ return \implode (' ' , \array_map ('BladeOne ::convertArgCallBack ' , \array_keys ($ array ), $ array ));
1672
1673
}
1673
1674
1674
1675
/**
0 commit comments