[php] add @var type hinting rel. #2812

This commit is contained in:
nao-pon
2019-01-03 23:38:39 +09:00
parent 67743e3081
commit ff42f6df28
5 changed files with 63 additions and 1 deletions
+1
View File
@@ -96,6 +96,7 @@ class elFinderEditorOnlineConvert extends elFinderEditor
} else {
$data = json_decode($response, true);
if (isset($data['status']) && isset($data['status']['code']) && $data['status']['code'] === 'completed') {
/** @var elFinderSession $session */
$session = $this->elfinder->getSession();
$urlContentSaveIds = $session->get('urlContentSaveIds', array());
$urlContentSaveIds['OnlineConvert-' . $data['id']] = true;
+3
View File
@@ -45,6 +45,7 @@ class elFinderEditorZohoOffice extends elFinderEditor
if (!empty($this->args['target'])) {
$fp = $cfile = null;
$hash = $this->args['target'];
/** @var elFinderVolumeDriver $srcVol */
if (($srcVol = $this->elfinder->getVolume($hash)) && ($file = $srcVol->file($hash))) {
$cdata = empty($this->args['cdata']) ? '' : $this->args['cdata'];
$cookie = $this->elfinder->getFetchCookieFile();
@@ -148,6 +149,7 @@ class elFinderEditorZohoOffice extends elFinderEditor
{
if (isset($_POST) && !empty($_POST['id'])) {
$hash = $_POST['id'];
/** @var elFinderVolumeDriver $volume */
if ($volume = $this->elfinder->getVolume($hash)) {
$content = file_get_contents($_FILES['content']['tmp_name']);
if ($volume->putContents($hash, $content)) {
@@ -162,6 +164,7 @@ class elFinderEditorZohoOffice extends elFinderEditor
{
$hash = $this->args['target'];
$res = false;
/** @var elFinderVolumeDriver $volume */
if ($volume = $this->elfinder->getVolume($hash)) {
if ($file = $volume->file($hash)) {
$res = (bool)$file['write'];
+40
View File
@@ -5639,6 +5639,16 @@ abstract class elFinderVolumeDriver
case 'convert':
extract($this->imageMagickConvertPrepare($path, $destformat, $jpgQuality, $s));
/**
* @var string $ani
* @var string $index
* @var string $coalesce
* @var string $deconstruct
* @var string $jpgQuality
* @var string $quotedPath
* @var string $quotedDstPath
* @var string $interlace
*/
$filter = ($destformat === 'png' /* createTmb */) ? '-filter Box' : '-filter Lanczos';
$strip = (isset($options['preserveExif']) && !$options['preserveExif']) ? ' -strip' : '';
$cmd = sprintf('%s %s%s%s%s%s %s -geometry %dx%d! %s %s', ELFINDER_CONVERT_PATH, $quotedPath, $coalesce, $jpgQuality, $strip, $interlace, $filter, $size_w, $size_h, $deconstruct, $quotedDstPath);
@@ -5753,6 +5763,16 @@ abstract class elFinderVolumeDriver
case 'convert':
extract($this->imageMagickConvertPrepare($path, $destformat, $jpgQuality, $s));
/**
* @var string $ani
* @var string $index
* @var string $coalesce
* @var string $deconstruct
* @var string $jpgQuality
* @var string $quotedPath
* @var string $quotedDstPath
* @var string $interlace
*/
$cmd = sprintf('%s %s%s%s%s -crop %dx%d+%d+%d%s %s', ELFINDER_CONVERT_PATH, $quotedPath, $coalesce, $jpgQuality, $interlace, $width, $height, $x, $y, $deconstruct, $quotedDstPath);
$result = false;
@@ -5892,6 +5912,16 @@ abstract class elFinderVolumeDriver
case 'convert':
extract($this->imageMagickConvertPrepare($path, $destformat, $jpgQuality, $s));
/**
* @var string $ani
* @var string $index
* @var string $coalesce
* @var string $deconstruct
* @var string $jpgQuality
* @var string $quotedPath
* @var string $quotedDstPath
* @var string $interlace
*/
if ($bgcolor === 'transparent') {
$bgcolor = 'rgba(255, 255, 255, 0.0)';
}
@@ -6022,6 +6052,16 @@ abstract class elFinderVolumeDriver
case 'convert':
extract($this->imageMagickConvertPrepare($path, $destformat, $jpgQuality, $s));
/**
* @var string $ani
* @var string $index
* @var string $coalesce
* @var string $deconstruct
* @var string $jpgQuality
* @var string $quotedPath
* @var string $quotedDstPath
* @var string $interlace
*/
if ($s[2] === IMAGETYPE_GIF || $s[2] === IMAGETYPE_PNG) {
$bgcolor = 'rgba(255, 255, 255, 0.0)';
}
+1 -1
View File
@@ -501,7 +501,7 @@ class elFinderVolumeFTP extends elFinderVolumeDriver
* If the owner parameter is false to understand if the user is the file owner we compare the ftp user with the file owner id.
* @param Boolean $isowner . Tell if the current user is the owner of the object.
*
* @return string
* @return array
* @author Dmitry (dio) Levashov
* @author Ugo Vierucci
*/
+18
View File
@@ -198,6 +198,18 @@ class elFinderLibGdBmp
"Vclr_used/" .
"Vclr_important", $buf
));
/**
* @var integer $width
* @var integer $height
* @var integer $planes
* @var integer $bit_count
* @var integer $compression
* @var integer $size_image
* @var integer $x_pels_per_meter
* @var integer $y_pels_per_meter
* @var integer $clr_used
* @var integer $clr_important
*/
//負の整数を受け取る可能性があるものは自前で変換する
if ($width & 0x80000000) {
$width = -(~$width & 0xffffffff) - 1;
@@ -317,6 +329,12 @@ class elFinderLibGdBmp
return false;
}
extract(unpack("Cb/Cg/Cr/Cx", $buf . "\x00"));
/**
* @var integer $b
* @var integer $g
* @var integer $r
* @var integer $x
*/
$palette[] = imagecolorallocate($img, $r, $g, $b);
}