public static function touchFile(string $file, int $permissions = 0777): string
    {
        self::createDirectory(\dirname($file));
        
        if (!@\touch($file)) {
            throw new \RuntimeException(\sprintf('Unable to touch file "%s"%s', $file, self::getErrorInfo()));
        }
        
        self::changePermissions($file, $permissions);
        
        \clearstatcache(true, $file);
        
        return $file;
    }
public static function touchFile(string $file, int $permissions = 0777): string
    {
        self::createDirectory(\dirname($file));
        
        if (!@\touch($file)) {
            throw new \RuntimeException(\sprintf('Unable to touch file "%s"%s', $file, self::getErrorInfo()));
        }
        
        self::changePermissions($file, $permissions);
        
        \clearstatcache(true, $file);
        
        return $file;
    }
public static function touchFile ( string $ file , int $ permissions = 0777 ) : string { self :: createDirectory ( \ dirname ( $ file ) ) ; if ( ! @ \ touch ( $ file ) ) { throw new \ RuntimeException ( \ sprintf ( 'Unable to touch file "%s"%s' , $ file , self :: getErrorInfo ( ) ) ) ; } self :: changePermissions ( $ file , $ permissions ) ; \ clearstatcache ( true , $ file ) ; return $ file ; }
Touches the given file and ensures the given access permissions are set.

@param string $file
@param int $permissions
@param string The touched file's location.

@throws \RuntimeException When the given file could not be touched.
Touches the given file and ensures the given access permissions are set .