public static function getArrayType(string $type): ?string
    {
        if (substr($type, -2) !== '[]' || strlen($type) === 2) {
            return null;
        }

        return substr($type, 0, -2);
    }
public static function getArrayType(string $type): ?string
    {
        if (substr($type, -2) !== '[]' || strlen($type) === 2) {
            return null;
        }

        return substr($type, 0, -2);
    }
public static function getArrayType ( string $ type ) : ? string { if ( substr ( $ type , - 2 ) !== '[]' || strlen ( $ type ) === 2 ) { return null ; } return substr ( $ type , 0 , - 2 ) ; }
Gets the type of the array if there is one

@param string $type The type to check
@return string|null The type contained in the array if there is one, otherwise null
Gets the type of the array if there is one