Fix docs generation, PSR-12 type compliance (#790)

* Correct docs generation, fixes #774

* Standardise on unaliased int and bool types, as per PSR-12 section 2.5
This commit is contained in:
Marcus Bointon 2021-03-02 15:39:45 +01:00 committed by GitHub
commit 8f7575b076
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
29 changed files with 58 additions and 60 deletions

View file

@ -22,8 +22,8 @@ class Dimension
private $height; private $height;
/** /**
* @param integer $width * @param int $width
* @param integer $height * @param int $height
* *
* @throws InvalidArgumentException when one of the parameteres is invalid * @throws InvalidArgumentException when one of the parameteres is invalid
*/ */
@ -40,7 +40,7 @@ class Dimension
/** /**
* Returns width. * Returns width.
* *
* @return integer * @return int
*/ */
public function getWidth() public function getWidth()
{ {
@ -50,7 +50,7 @@ class Dimension
/** /**
* Returns height. * Returns height.
* *
* @return integer * @return int
*/ */
public function getHeight() public function getHeight()
{ {
@ -60,7 +60,7 @@ class Dimension
/** /**
* Returns the ratio. * Returns the ratio.
* *
* @param type $forceStandards Whether or not force the use of standards ratios; * @param bool $forceStandards Whether or not force the use of standards ratios;
* *
* @return AspectRatio * @return AspectRatio
*/ */

View file

@ -28,7 +28,7 @@ class Point
} }
/** /**
* @return integer * @return int
*/ */
public function getX() public function getX()
{ {
@ -36,7 +36,7 @@ class Point
} }
/** /**
* @return integer * @return int
*/ */
public function getY() public function getY()
{ {

View file

@ -47,7 +47,7 @@ class ComplexFilterContainer implements ComplexFilterInterface
/** /**
* Returns the priority of the filter. * Returns the priority of the filter.
* *
* @return integer * @return int
*/ */
public function getPriority() public function getPriority()
{ {

View file

@ -18,7 +18,7 @@ class AudioResamplableFilter implements AudioFilterInterface
{ {
/** @var string */ /** @var string */
private $rate; private $rate;
/** @var integer */ /** @var int */
private $priority; private $priority;
public function __construct($rate, $priority = 0) public function __construct($rate, $priority = 0)

View file

@ -17,7 +17,7 @@ class CustomFilter implements AudioFilterInterface
{ {
/** @var string */ /** @var string */
private $filter; private $filter;
/** @var integer */ /** @var int */
private $priority; private $priority;
/** /**

View file

@ -16,7 +16,7 @@ interface FilterInterface
/** /**
* Returns the priority of the filter. * Returns the priority of the filter.
* *
* @return integer * @return int
*/ */
public function getPriority(); public function getPriority();
} }

View file

@ -18,7 +18,7 @@ class CustomFrameFilter implements FrameFilterInterface
{ {
/** @var string */ /** @var string */
private $filter; private $filter;
/** @var integer */ /** @var int */
private $priority; private $priority;
/** /**

View file

@ -16,7 +16,7 @@ use FFMpeg\Media\Frame;
class DisplayRatioFixerFilter implements FrameFilterInterface class DisplayRatioFixerFilter implements FrameFilterInterface
{ {
/** @var integer */ /** @var int */
private $priority; private $priority;
public function __construct($priority = 0) public function __construct($priority = 0)

View file

@ -21,7 +21,7 @@ class ClipFilter implements VideoFilterInterface
private $start; private $start;
/** @var TimeCode */ /** @var TimeCode */
private $duration; private $duration;
/** @var integer */ /** @var int */
private $priority; private $priority;
public function __construct(TimeCode $start, TimeCode $duration = null, $priority = 0) public function __construct(TimeCode $start, TimeCode $duration = null, $priority = 0)

View file

@ -17,7 +17,7 @@ use FFMpeg\Media\Video;
class CropFilter implements VideoFilterInterface class CropFilter implements VideoFilterInterface
{ {
/** @var integer */ /** @var int */
protected $priority; protected $priority;
/** @var Dimension */ /** @var Dimension */
protected $dimension; protected $dimension;

View file

@ -17,7 +17,7 @@ class CustomFilter implements VideoFilterInterface
{ {
/** @var string */ /** @var string */
private $filter; private $filter;
/** @var integer */ /** @var int */
private $priority; private $priority;
/** /**

View file

@ -21,7 +21,7 @@ class PadFilter implements VideoFilterInterface, ComplexCompatibleFilter
{ {
/** @var Dimension */ /** @var Dimension */
private $dimension; private $dimension;
/** @var integer */ /** @var int */
private $priority; private $priority;
public function __construct(Dimension $dimension, $priority = 0) public function __construct(Dimension $dimension, $priority = 0)

View file

@ -33,7 +33,7 @@ class ResizeFilter implements VideoFilterInterface
private $mode; private $mode;
/** @var bool */ /** @var bool */
private $forceStandards; private $forceStandards;
/** @var integer */ /** @var int */
private $priority; private $priority;
public function __construct(Dimension $dimension, $mode = self::RESIZEMODE_FIT, $forceStandards = true, $priority = 0) public function __construct(Dimension $dimension, $mode = self::RESIZEMODE_FIT, $forceStandards = true, $priority = 0)

View file

@ -24,7 +24,7 @@ class RotateFilter implements VideoFilterInterface
/** @var string */ /** @var string */
private $angle; private $angle;
/** @var integer */ /** @var int */
private $priority; private $priority;
public function __construct($angle, $priority = 0) public function __construct($angle, $priority = 0)

View file

@ -23,7 +23,7 @@ class WatermarkFilter implements VideoFilterInterface, ComplexCompatibleFilter
private $watermarkPath; private $watermarkPath;
/** @var array */ /** @var array */
private $coordinates; private $coordinates;
/** @var integer */ /** @var int */
private $priority; private $priority;
public function __construct($watermarkPath, array $coordinates = array(), $priority = 0) public function __construct($watermarkPath, array $coordinates = array(), $priority = 0)

View file

@ -17,9 +17,9 @@ use FFMpeg\Media\Waveform;
class WaveformDownmixFilter implements WaveformFilterInterface class WaveformDownmixFilter implements WaveformFilterInterface
{ {
/** @var boolean */ /** @var bool */
private $downmix; private $downmix;
/** @var integer */ /** @var int */
private $priority; private $priority;
// By default, the downmix value is set to FALSE. // By default, the downmix value is set to FALSE.

View file

@ -24,10 +24,10 @@ abstract class DefaultAudio extends EventEmitter implements AudioInterface, Prog
/** @var string */ /** @var string */
protected $audioCodec; protected $audioCodec;
/** @var integer */ /** @var int */
protected $audioKiloBitrate = 128; protected $audioKiloBitrate = 128;
/** @var integer */ /** @var int */
protected $audioChannels = null; protected $audioChannels = null;
/** /**
@ -79,7 +79,7 @@ abstract class DefaultAudio extends EventEmitter implements AudioInterface, Prog
/** /**
* Sets the kiloBitrate value. * Sets the kiloBitrate value.
* *
* @param integer $kiloBitrate * @param int $kiloBitrate
* @throws InvalidArgumentException * @throws InvalidArgumentException
*/ */
public function setAudioKiloBitrate($kiloBitrate) public function setAudioKiloBitrate($kiloBitrate)
@ -104,7 +104,7 @@ abstract class DefaultAudio extends EventEmitter implements AudioInterface, Prog
/** /**
* Sets the channels value. * Sets the channels value.
* *
* @param integer $channels * @param int $channels
* @throws InvalidArgumentException * @throws InvalidArgumentException
*/ */
public function setAudioChannels($channels) public function setAudioChannels($channels)

View file

@ -15,14 +15,14 @@ interface AudioInterface extends FormatInterface
/** /**
* Gets the audio kiloBitrate value. * Gets the audio kiloBitrate value.
* *
* @return integer * @return int
*/ */
public function getAudioKiloBitrate(); public function getAudioKiloBitrate();
/** /**
* Gets the audio channels value. * Gets the audio channels value.
* *
* @return integer * @return int
*/ */
public function getAudioChannels(); public function getAudioChannels();

View file

@ -22,7 +22,7 @@ interface FormatInterface
/** /**
* Returns an array of extra parameters to add to ffmpeg commandline. * Returns an array of extra parameters to add to ffmpeg commandline.
* *
* @return array() * @return array
*/ */
public function getExtraParams(); public function getExtraParams();
} }

View file

@ -21,16 +21,16 @@ use FFMpeg\Exception\RuntimeException;
*/ */
abstract class AbstractProgressListener extends EventEmitter implements ListenerInterface abstract class AbstractProgressListener extends EventEmitter implements ListenerInterface
{ {
/** @var integer */ /** @var int */
private $duration; private $duration;
/** @var integer */ /** @var int */
private $totalSize; private $totalSize;
/** @var integer */ /** @var int */
private $currentSize; private $currentSize;
/** @var integer */ /** @var int */
private $currentTime; private $currentTime;
/** @var double */ /** @var double */
@ -45,40 +45,39 @@ abstract class AbstractProgressListener extends EventEmitter implements Listener
/** @var bool */ /** @var bool */
private $initialized = false; private $initialized = false;
/** @var integer */ /** @var int */
private $currentPass; private $currentPass;
/** @var integer */ /** @var int */
private $totalPass; private $totalPass;
/** /**
* Transcoding rate in kb/s * Transcoding rate in kb/s
* *
* @var integer * @var int
*/ */
private $rate; private $rate;
/** /**
* Percentage of transcoding progress (0 - 100) * Percentage of transcoding progress (0 - 100)
* *
* @var integer * @var int
*/ */
private $percent = 0; private $percent = 0;
/** /**
* Time remaining (seconds) * Time remaining (seconds)
* *
* @var integer * @var int
*/ */
private $remaining = null; private $remaining = null;
/** /**
* @param FFProbe $ffprobe * @param FFProbe $ffprobe
* @param string $pathfile * @param string $pathfile
* @param integer $currentPass The cureent pass number * @param int $currentPass The current pass number
* @param integer $totalPass The total number of passes * @param int $totalPass The total number of passes
* * @param int $duration
* @throws RuntimeException
*/ */
public function __construct(FFProbe $ffprobe, $pathfile, $currentPass, $totalPass, $duration = 0) public function __construct(FFProbe $ffprobe, $pathfile, $currentPass, $totalPass, $duration = 0)
{ {
@ -106,7 +105,7 @@ abstract class AbstractProgressListener extends EventEmitter implements Listener
} }
/** /**
* @return integer * @return int
*/ */
public function getCurrentPass() public function getCurrentPass()
{ {
@ -114,7 +113,7 @@ abstract class AbstractProgressListener extends EventEmitter implements Listener
} }
/** /**
* @return integer * @return int
*/ */
public function getTotalPass() public function getTotalPass()
{ {

View file

@ -49,7 +49,7 @@ abstract class DefaultVideo extends DefaultAudio implements VideoInterface
/** /**
* Sets the kiloBitrate value. * Sets the kiloBitrate value.
* *
* @param integer $kiloBitrate * @param int $kiloBitrate
* @throws InvalidArgumentException * @throws InvalidArgumentException
*/ */
public function setKiloBitrate($kiloBitrate) public function setKiloBitrate($kiloBitrate)
@ -93,7 +93,7 @@ abstract class DefaultVideo extends DefaultAudio implements VideoInterface
} }
/** /**
* @return integer * @return int
*/ */
public function getModulus() public function getModulus()
{ {

View file

@ -16,10 +16,10 @@ namespace FFMpeg\Format\Video;
*/ */
class X264 extends DefaultVideo class X264 extends DefaultVideo
{ {
/** @var boolean */ /** @var bool */
private $bframesSupport = true; private $bframesSupport = true;
/** @var integer */ /** @var int */
private $passes = 2; private $passes = 2;
public function __construct($audioCodec = 'libfaac', $videoCodec = 'libx264') public function __construct($audioCodec = 'libfaac', $videoCodec = 'libx264')

View file

@ -16,7 +16,7 @@ interface VideoInterface extends AudioInterface
/** /**
* Gets the kiloBitrate value. * Gets the kiloBitrate value.
* *
* @return integer * @return int
*/ */
public function getKiloBitrate(); public function getKiloBitrate();
@ -28,7 +28,7 @@ interface VideoInterface extends AudioInterface
* *
* @see http://www.undeadborn.net/tools/rescalculator.php * @see http://www.undeadborn.net/tools/rescalculator.php
* *
* @return integer * @return int
*/ */
public function getModulus(); public function getModulus();

View file

@ -130,8 +130,8 @@ class Audio extends AbstractStreamableMedia
/** /**
* Gets the waveform of the video. * Gets the waveform of the video.
* *
* @param integer $width * @param int $width
* @param integer $height * @param int $height
* @param array $colors Array of colors for ffmpeg to use. Color format is #000000 (RGB hex string with #) * @param array $colors Array of colors for ffmpeg to use. Color format is #000000 (RGB hex string with #)
* @return Waveform * @return Waveform
*/ */

View file

@ -35,7 +35,6 @@ class Clip extends Video
/** /**
* Returns the video related to the frame. * Returns the video related to the frame.
* *
* @param FormatInterface $format
* @return Video * @return Video
*/ */
public function getVideo() public function getVideo()

View file

@ -156,11 +156,10 @@ class Concat extends AbstractMediaType
/** /**
* Saves the concatenated video in the given filename, considering that the sources videos are all encoded with the same codec. * Saves the concatenated video in the given filename, considering that the sources videos are all encoded with the same codec.
* *
* @param string $outputPathfile * @param FormatInterface $format
* @param string $outputPathfile
* *
* @return Concat * @return Concat
*
* @throws RuntimeException
*/ */
public function saveFromDifferentCodecs(FormatInterface $format, $outputPathfile) public function saveFromDifferentCodecs(FormatInterface $format, $outputPathfile)
{ {

View file

@ -78,8 +78,9 @@ class Frame extends AbstractMediaType
* *
* Uses the `unaccurate method by default.` * Uses the `unaccurate method by default.`
* *
* @param string $pathfile * @param string $pathfile
* @param bool $accurate * @param bool $accurate
* @param bool $returnBase64
* *
* @return Frame * @return Frame
* *

View file

@ -26,7 +26,7 @@ class Gif extends AbstractMediaType
private $timecode; private $timecode;
/** @var Dimension */ /** @var Dimension */
private $dimension; private $dimension;
/** @var integer */ /** @var int */
private $duration; private $duration;
/** @var Video */ /** @var Video */
private $video; private $video;

View file

@ -31,7 +31,7 @@ class Video extends AbstractVideo
* *
* @param TimeCode $at * @param TimeCode $at
* @param Dimension $dimension * @param Dimension $dimension
* @param integer $duration * @param int $duration
* @return Gif * @return Gif
*/ */
public function gif(TimeCode $at, Dimension $dimension, $duration = null) public function gif(TimeCode $at, Dimension $dimension, $duration = null)