X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fdoctrine%2Fcache%2Flib%2FDoctrine%2FCommon%2FCache%2FFileCache.php;fp=vendor%2Fdoctrine%2Fcache%2Flib%2FDoctrine%2FCommon%2FCache%2FFileCache.php;h=5293b8fddac20585bd5e32a08677e268892666f7;hp=b2e0427e59a9a88b38eabd851a2799b3a1cc081b;hb=5e458ff8cb4924fd5fa03b80d8edfcc52fe43479;hpb=9917807b03b64faf00f6a1f29dcb6eafc454efa5 diff --git a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/FileCache.php b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/FileCache.php index b2e0427e5..5293b8fdd 100644 --- a/vendor/doctrine/cache/lib/Doctrine/Common/Cache/FileCache.php +++ b/vendor/doctrine/cache/lib/Doctrine/Common/Cache/FileCache.php @@ -202,13 +202,13 @@ abstract class FileCache extends CacheProvider $free = disk_free_space($this->directory); - return array( + return [ Cache::STATS_HITS => null, Cache::STATS_MISSES => null, Cache::STATS_UPTIME => null, Cache::STATS_MEMORY_USAGE => $usage, Cache::STATS_MEMORY_AVAILABLE => $free, - ); + ]; } /** @@ -217,7 +217,7 @@ abstract class FileCache extends CacheProvider * @param string $path * @return bool TRUE on success or if path already exists, FALSE if path cannot be created. */ - private function createPathIfNeeded($path) + private function createPathIfNeeded(string $path) : bool { if ( ! is_dir($path)) { if (false === @mkdir($path, 0777 & (~$this->umask), true) && !is_dir($path)) { @@ -236,7 +236,7 @@ abstract class FileCache extends CacheProvider * * @return bool TRUE on success, FALSE if path cannot be created, if path is not writable or an any other error. */ - protected function writeFile($filename, $content) + protected function writeFile(string $filename, string $content) : bool { $filepath = pathinfo($filename, PATHINFO_DIRNAME); @@ -252,6 +252,7 @@ abstract class FileCache extends CacheProvider @chmod($tmpFile, 0666 & (~$this->umask)); if (file_put_contents($tmpFile, $content) !== false) { + @chmod($tmpFile, 0666 & (~$this->umask)); if (@rename($tmpFile, $filename)) { return true; } @@ -265,7 +266,7 @@ abstract class FileCache extends CacheProvider /** * @return \Iterator */ - private function getIterator() + private function getIterator() : \Iterator { return new \RecursiveIteratorIterator( new \RecursiveDirectoryIterator($this->directory, \FilesystemIterator::SKIP_DOTS), @@ -278,7 +279,7 @@ abstract class FileCache extends CacheProvider * * @return bool */ - private function isFilenameEndingWithExtension($name) + private function isFilenameEndingWithExtension(string $name) : bool { return '' === $this->extension || strrpos($name, $this->extension) === (strlen($name) - $this->extensionStringLength);