@@ -30,8 +30,8 @@ abstract protected static function doParse(
3030 $ string ,
3131 $ enhancement = false ,
3232 callable $ pathHandler = null ,
33- $ fileDir = ''
34- );
33+ string $ fileDir = ''
34+ ): array ;
3535
3636 /**
3737 * @param $string
@@ -40,7 +40,7 @@ abstract protected static function doParse(
4040 * @param string $fileDir
4141 * @return array
4242 */
43- public static function parse ($ string , $ enhancement = false , callable $ pathHandler = null , $ fileDir = '' )
43+ public static function parse ($ string , $ enhancement = false , callable $ pathHandler = null , $ fileDir = '' ): array
4444 {
4545 if (is_file ($ string )) {
4646 return self ::parseFile ($ string , $ enhancement , $ pathHandler , $ fileDir );
@@ -57,7 +57,7 @@ public static function parse($string, $enhancement = false, callable $pathHandle
5757 * @return array
5858 * @throws \InvalidArgumentException
5959 */
60- public static function parseFile ($ file , $ enhancement = false , callable $ pathHandler = null , $ fileDir = '' )
60+ public static function parseFile ($ file , $ enhancement = false , callable $ pathHandler = null , $ fileDir = '' ): array
6161 {
6262 if (!is_file ($ file )) {
6363 throw new \InvalidArgumentException ("Target file [ $ file] not exists " );
@@ -76,7 +76,7 @@ public static function parseFile($file, $enhancement = false, callable $pathHand
7676 * @param string $fileDir
7777 * @return array
7878 */
79- public static function parseString ($ string , $ enhancement = false , callable $ pathHandler = null , $ fileDir = '' )
79+ public static function parseString ($ string , $ enhancement = false , callable $ pathHandler = null , $ fileDir = '' ): array
8080 {
8181 return static ::doParse ($ string , $ enhancement , $ pathHandler , $ fileDir );
8282 }
0 commit comments