X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;ds=sidebyside;f=includes%2Ffilebackend%2FTempFSFile.php;h=3ec34f18a132f850523d229259506443762c42c0;hb=8d21402039091b410fcc01b551fbf636e9a849bb;hp=312b65c1b65de389937a9b930691b4cb7b9a2f77;hpb=c4c1d277ee138892b7117800a4b88dfca25e3d24;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/filebackend/TempFSFile.php b/includes/filebackend/TempFSFile.php index 312b65c1b6..3ec34f18a1 100644 --- a/includes/filebackend/TempFSFile.php +++ b/includes/filebackend/TempFSFile.php @@ -32,7 +32,7 @@ class TempFSFile extends FSFile { protected $canDelete = false; /** @var array Active temp files to purge on shutdown */ - protected static $instances = array(); + protected static $instances = []; /** @var array Map of (path => 1) for paths to delete on shutdown */ protected static $pathsCollect = null; @@ -41,8 +41,8 @@ class TempFSFile extends FSFile { parent::__construct( $path ); if ( self::$pathsCollect === null ) { - self::$pathsCollect = array(); - register_shutdown_function( array( __CLASS__, 'purgeAllOnShutdown' ) ); + self::$pathsCollect = []; + register_shutdown_function( [ __CLASS__, 'purgeAllOnShutdown' ] ); } } @@ -67,7 +67,6 @@ class TempFSFile extends FSFile { break; // got it } if ( $attempt >= 5 ) { - return null; // give up } } @@ -103,7 +102,7 @@ class TempFSFile extends FSFile { if ( is_object( $object ) ) { if ( !isset( $object->tempFSFileReferences ) ) { // Init first since $object might use __get() and return only a copy variable - $object->tempFSFileReferences = array(); + $object->tempFSFileReferences = []; } $object->tempFSFileReferences[] = $this; }