public static function setFiles(array $files): array
    {
        $previousFiles = self::$files;
        self::$files = $files;

        foreach (self::$openedFiles as $file) {
            if ($file) {
                flock($file, LOCK_UN);
                fclose($file);
            }
        }
        self::$openedFiles = self::$lockedFiles = [];

        return $previousFiles;
    }
public static function setFiles(array $files): array
    {
        $previousFiles = self::$files;
        self::$files = $files;

        foreach (self::$openedFiles as $file) {
            if ($file) {
                flock($file, LOCK_UN);
                fclose($file);
            }
        }
        self::$openedFiles = self::$lockedFiles = [];

        return $previousFiles;
    }
public static function setFiles ( array $ files ) : array { $ previousFiles = self :: $ files ; self :: $ files = $ files ; foreach ( self :: $ openedFiles as $ file ) { if ( $ file ) { flock ( $ file , LOCK_UN ) ; fclose ( $ file ) ; } } self :: $ openedFiles = self :: $ lockedFiles = [ ] ; return $ previousFiles ; }
Defines a set of existing files that will be used as keys to acquire locks.

@return array The previously defined set of files
Defines a set of existing files that will be used as keys to acquire locks .