for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace wapmorgan\UnifiedArchive\Formats;
/**
* Class Lzma
*
* @package wapmorgan\UnifiedArchive\Formats
* @requires ext-lzma2
*/
class Lzma extends OneFileFormat
{
const FORMAT_SUFFIX = 'xz';
* Lzma constructor.
* @param $archiveFileName
* @throws \Exception
public function __construct($archiveFileName)
parent::__construct($archiveFileName);
$this->modificationTime = filemtime($this->fileName);
}
* @param string $fileName
* @return string|false
public function getFileContent($fileName = null)
return stream_get_contents(xzopen($this->fileName, 'r'));
xzopen
If this is a false-positive, you can also ignore this issue in your code via the ignore-call annotation
ignore-call
return stream_get_contents(/** @scrutinizer ignore-call */ xzopen($this->fileName, 'r'));
* @return bool|resource|string
public function getFileResource($fileName = null)
return xzopen($this->fileName, 'r');
return /** @scrutinizer ignore-call */ xzopen($this->fileName, 'r');
* @param $data
* @return mixed|string
protected static function compressData($data)
$fp = xzopen('php://temp', 'w');
$fp = /** @scrutinizer ignore-call */ xzopen('php://temp', 'w');
xzwrite($fp, $data);
xzwrite
/** @scrutinizer ignore-call */
$data = stream_get_contents($fp);
xzclose($fp);
xzclose
return $data;