diff --git a/.github/workflows/code_checks.yml b/.github/workflows/code_checks.yml index 09aa08d..64cd8e5 100644 --- a/.github/workflows/code_checks.yml +++ b/.github/workflows/code_checks.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - php: ["7.2", "7.3", "7.4", "8.0", "8.1", "8.2"] + php: ["7.4", "8.0", "8.1", "8.2", "8.3", "8.4"] name: PHP ${{ matrix.php }} tests steps: @@ -33,7 +33,7 @@ jobs: # see https://github.com/shivammathur/setup-php - uses: shivammathur/setup-php@v2 with: - php-version: 7.2 + php-version: 7.4 coverage: none - run: composer update --no-progress --prefer-lowest @@ -47,7 +47,7 @@ jobs: # see https://github.com/shivammathur/setup-php - uses: shivammathur/setup-php@v2 with: - php-version: 7.2 + php-version: 7.4 coverage: none - run: composer install @@ -62,7 +62,7 @@ jobs: # see https://github.com/shivammathur/setup-php - uses: shivammathur/setup-php@v2 with: - php-version: 7.3 + php-version: 7.4 coverage: none - run: composer install @@ -92,7 +92,7 @@ jobs: # see https://github.com/shivammathur/setup-php - uses: shivammathur/setup-php@v2 with: - php-version: 7.4 + php-version: 8.2 coverage: none - run: composer install @@ -107,7 +107,7 @@ jobs: # see https://github.com/shivammathur/setup-php - uses: shivammathur/setup-php@v2 with: - php-version: 8.2 + php-version: 8.3 coverage: none - run: composer install @@ -122,7 +122,7 @@ jobs: # see https://github.com/shivammathur/setup-php - uses: shivammathur/setup-php@v2 with: - php-version: 8.2 + php-version: 8.4 coverage: none - run: composer install @@ -136,7 +136,7 @@ jobs: # see https://github.com/shivammathur/setup-php - uses: shivammathur/setup-php@v2 with: - php-version: 8.0 + php-version: 8.4 coverage: none - run: composer install --no-progress diff --git a/composer.json b/composer.json index e184397..1fc0ddb 100644 --- a/composer.json +++ b/composer.json @@ -16,7 +16,7 @@ } ], "require": { - "php": ">=7.2", + "php": ">=7.4", "symfony/process": "~3.4|~4.0|~5.0|~6.0|~7.0", "symfony/filesystem": "~3.4|~4.0|~5.0|~6.0|~7.0" }, diff --git a/src/Attribute/AttributeInterface.php b/src/Attribute/AttributeInterface.php index 4e63e09..6ad84f0 100644 --- a/src/Attribute/AttributeInterface.php +++ b/src/Attribute/AttributeInterface.php @@ -4,8 +4,5 @@ interface AttributeInterface extends \JsonSerializable { - /** - * @return string - */ public function __toString(): string; } diff --git a/src/Attribute/Cover.php b/src/Attribute/Cover.php index c5a0617..a1122f3 100644 --- a/src/Attribute/Cover.php +++ b/src/Attribute/Cover.php @@ -7,31 +7,19 @@ class Cover implements AttributeInterface { use DumpTrait; + + protected string $binaryCover; - /** - * @var string - */ - protected $binaryCover; - - /** - * @param string $cover - */ public function __construct(string $cover) { $this->binaryCover = $cover; } - /** - * @return string - */ public function getBinaryCover(): string { return $this->binaryCover; } - /** - * @return string - */ public function __toString(): string { return $this->binaryCover; diff --git a/src/Attribute/Duration.php b/src/Attribute/Duration.php index b89cd90..b5f1534 100644 --- a/src/Attribute/Duration.php +++ b/src/Attribute/Duration.php @@ -8,30 +8,18 @@ class Duration implements AttributeInterface { use DumpTrait; - /** - * @var int - */ - protected $milliseconds; + protected int $milliseconds; - /** - * @param string|int $duration - */ public function __construct($duration) { $this->milliseconds = (int) $duration; } - /** - * @return int - */ public function getMilliseconds(): int { return $this->milliseconds; } - /** - * @return string - */ public function __toString(): string { return (string) $this->milliseconds; diff --git a/src/Attribute/FloatRate.php b/src/Attribute/FloatRate.php index eadecbe..ccd5f70 100644 --- a/src/Attribute/FloatRate.php +++ b/src/Attribute/FloatRate.php @@ -4,9 +4,6 @@ class FloatRate extends Rate { - /** - * @return float - */ public function getFloatAbsoluteValue(): float { return $this->absoluteValue; diff --git a/src/Attribute/Mode.php b/src/Attribute/Mode.php index e0bb95e..85c6f70 100644 --- a/src/Attribute/Mode.php +++ b/src/Attribute/Mode.php @@ -8,45 +8,26 @@ class Mode implements AttributeInterface { use DumpTrait; - /** - * @var string - */ - protected $shortName; - - /** - * @var string - */ - protected $fullName; - - /** - * @param string $shortName - * @param string $fullName - */ + protected string $shortName; + + protected string $fullName; + public function __construct(string $shortName, string $fullName) { $this->shortName = $shortName; $this->fullName = $fullName; } - /** - * @return string - */ public function getFullName(): string { return $this->fullName; } - /** - * @return string - */ public function getShortName(): string { return $this->shortName; } - /** - * @return string - */ public function __toString(): string { return $this->shortName; diff --git a/src/Attribute/Rate.php b/src/Attribute/Rate.php index b3eb28d..656b593 100644 --- a/src/Attribute/Rate.php +++ b/src/Attribute/Rate.php @@ -8,19 +8,12 @@ class Rate implements AttributeInterface { use DumpTrait; - /** - * @var float - */ - protected $absoluteValue; + protected float $absoluteValue; - /** - * @var string - */ - protected $textValue; + protected string $textValue; /** * @param string|int $absoluteValue - * @param string $textValue */ public function __construct($absoluteValue, string $textValue) { @@ -28,25 +21,16 @@ public function __construct($absoluteValue, string $textValue) $this->textValue = $textValue; } - /** - * @return int - */ public function getAbsoluteValue(): int { return round($this->absoluteValue); } - /** - * @return string - */ public function getTextValue(): string { return $this->textValue; } - /** - * @return string - */ public function __toString(): string { return $this->textValue; diff --git a/src/Attribute/Ratio.php b/src/Attribute/Ratio.php index 4b106c4..582dbb3 100644 --- a/src/Attribute/Ratio.php +++ b/src/Attribute/Ratio.php @@ -8,19 +8,12 @@ class Ratio implements AttributeInterface { use DumpTrait; - /** - * @var float - */ - protected $absoluteValue; + protected float $absoluteValue; - /** - * @var string - */ - protected $textValue; + protected string $textValue; /** * @param string|float $absoluteValue - * @param string $textValue */ public function __construct($absoluteValue, string $textValue) { @@ -28,25 +21,16 @@ public function __construct($absoluteValue, string $textValue) $this->textValue = $textValue; } - /** - * @return float - */ public function getAbsoluteValue(): float { return $this->absoluteValue; } - /** - * @return string - */ public function getTextValue(): string { return $this->textValue; } - /** - * @return string - */ public function __toString(): string { return $this->textValue; diff --git a/src/Attribute/Size.php b/src/Attribute/Size.php index 0eefd05..099ad11 100644 --- a/src/Attribute/Size.php +++ b/src/Attribute/Size.php @@ -8,10 +8,7 @@ class Size implements AttributeInterface { use DumpTrait; - /** - * @var int - */ - protected $bit; + protected int $bit; /** * @param string|int $size @@ -21,17 +18,11 @@ public function __construct($size) $this->bit = (int) $size; } - /** - * @return int - */ public function getBit(): int { return $this->bit; } - /** - * @return string - */ public function __toString(): string { return (string) $this->bit; diff --git a/src/Builder/MediaInfoCommandBuilder.php b/src/Builder/MediaInfoCommandBuilder.php index ad02c3f..14bb713 100644 --- a/src/Builder/MediaInfoCommandBuilder.php +++ b/src/Builder/MediaInfoCommandBuilder.php @@ -9,12 +9,7 @@ class MediaInfoCommandBuilder { /** - * @param string $filePath - * @param array $configuration - * * @throws \Exception - * - * @return MediaInfoCommandRunner */ public function buildMediaInfoCommandRunner(string $filePath, array $configuration = []): MediaInfoCommandRunner { @@ -49,15 +44,7 @@ public function buildMediaInfoCommandRunner(string $filePath, array $configurati )); } - /** - * @param string $filePath - * @param string|null $command - * @param bool $forceOldXmlOutput - * @param bool $urlencode - * - * @return Process - */ - private function buildMediaInfoProcess(string $filePath, string $command = null, bool $forceOldXmlOutput = true, bool $urlencode = false, bool $includeCoverData = false): Process + private function buildMediaInfoProcess(string $filePath, ?string $command = null, bool $forceOldXmlOutput = true, bool $urlencode = false, bool $includeCoverData = false): Process { if ($command === null) { $command = MediaInfoCommandRunner::MEDIAINFO_COMMAND; diff --git a/src/Builder/MediaInfoContainerBuilder.php b/src/Builder/MediaInfoContainerBuilder.php index d36e13b..87285e2 100644 --- a/src/Builder/MediaInfoContainerBuilder.php +++ b/src/Builder/MediaInfoContainerBuilder.php @@ -9,51 +9,30 @@ class MediaInfoContainerBuilder { - /** - * @var MediaInfoContainer - */ - private $mediaInfoContainer; + private MediaInfoContainer $mediaInfoContainer; - /** - * @var TypeFactory - */ - private $typeFactory; + private TypeFactory $typeFactory; - /** - * @var AttributeFactory - */ - private $attributesFactory; + private AttributeFactory $attributesFactory; - /** - * @param array|null $attributesCheckers - */ - public function __construct(array $attributesCheckers = null) + public function __construct(?array $attributesCheckers = null) { $this->mediaInfoContainer = new MediaInfoContainer(); $this->typeFactory = new TypeFactory(); $this->attributesFactory = new AttributeFactory($attributesCheckers); } - /** - * @return MediaInfoContainer - */ public function build(): \Mhor\MediaInfo\Container\MediaInfoContainer { return $this->mediaInfoContainer; } - /** - * @param string $version - */ public function setVersion($version): void { $this->mediaInfoContainer->setVersion($version); } /** - * @param $typeName - * @param array $attributes - * * @throws \Mhor\MediaInfo\Exception\UnknownTrackTypeException */ public function addTrackType($typeName, array $attributes): void @@ -64,10 +43,6 @@ public function addTrackType($typeName, array $attributes): void $this->mediaInfoContainer->add($trackType); } - /** - * @param AbstractType $trackType - * @param array $attributes - */ private function addAttributes(AbstractType $trackType, array $attributes): void { foreach ($this->sanitizeAttributes($attributes) as $attribute => $value) { @@ -82,11 +57,6 @@ private function addAttributes(AbstractType $trackType, array $attributes): void } } - /** - * @param array $attributes - * - * @return array - */ private function sanitizeAttributes(array $attributes): array { $sanitizeAttributes = []; @@ -110,11 +80,6 @@ private function sanitizeAttributes(array $attributes): array return $sanitizeAttributes; } - /** - * @param string $attribute - * - * @return string - */ private function formatAttribute(string $attribute): string { return trim(str_replace('__', '_', str_replace(' ', '_', strtolower($attribute))), '_'); diff --git a/src/Checker/AbstractAttributeChecker.php b/src/Checker/AbstractAttributeChecker.php index d9a8343..e208632 100644 --- a/src/Checker/AbstractAttributeChecker.php +++ b/src/Checker/AbstractAttributeChecker.php @@ -4,11 +4,6 @@ abstract class AbstractAttributeChecker implements AttributeCheckerInterface { - /** - * @param string $attribute - * - * @return bool - */ public function isMember(string $attribute): bool { return in_array($attribute, $this->getMembersFields()); diff --git a/src/Checker/AttributeCheckerInterface.php b/src/Checker/AttributeCheckerInterface.php index 90a4b45..d8cbdd2 100644 --- a/src/Checker/AttributeCheckerInterface.php +++ b/src/Checker/AttributeCheckerInterface.php @@ -4,7 +4,7 @@ interface AttributeCheckerInterface { - public function getMembersFields(); + public function getMembersFields(): array; public function create($value); } diff --git a/src/Checker/CoverChecker.php b/src/Checker/CoverChecker.php index 33c7521..391a611 100644 --- a/src/Checker/CoverChecker.php +++ b/src/Checker/CoverChecker.php @@ -6,19 +6,11 @@ class CoverChecker extends AbstractAttributeChecker { - /** - * @param string $value - * - * @return Cover - */ public function create($value): \Mhor\MediaInfo\Attribute\Cover { return new Cover($value); } - /** - * @return array - */ public function getMembersFields(): array { return ['cover_data']; diff --git a/src/Checker/DateTimeChecker.php b/src/Checker/DateTimeChecker.php index 06d7c07..9fffd0b 100644 --- a/src/Checker/DateTimeChecker.php +++ b/src/Checker/DateTimeChecker.php @@ -4,19 +4,11 @@ class DateTimeChecker extends AbstractAttributeChecker { - /** - * @param string $value - * - * @return \DateTime - */ public function create($value): \DateTime { return new \DateTime($value); } - /** - * @return array - */ public function getMembersFields(): array { return [ diff --git a/src/Checker/DurationChecker.php b/src/Checker/DurationChecker.php index c6c1483..4f34f82 100644 --- a/src/Checker/DurationChecker.php +++ b/src/Checker/DurationChecker.php @@ -6,19 +6,11 @@ class DurationChecker extends AbstractAttributeChecker { - /** - * @param array $durations - * - * @return Duration - */ public function create($durations): \Mhor\MediaInfo\Attribute\Duration { return new Duration($durations[0]); } - /** - * @return array - */ public function getMembersFields(): array { return [ diff --git a/src/Checker/FloatRateChecker.php b/src/Checker/FloatRateChecker.php index 0585465..9095ce3 100644 --- a/src/Checker/FloatRateChecker.php +++ b/src/Checker/FloatRateChecker.php @@ -6,19 +6,11 @@ class FloatRateChecker extends AbstractAttributeChecker { - /** - * @param array $value - * - * @return FloatRate - */ public function create($value): FloatRate { return new FloatRate($value[0], $value[1]); } - /** - * @return array - */ public function getMembersFields(): array { return [ diff --git a/src/Checker/ModeChecker.php b/src/Checker/ModeChecker.php index 8a3be4c..36dd96c 100644 --- a/src/Checker/ModeChecker.php +++ b/src/Checker/ModeChecker.php @@ -7,9 +7,7 @@ class ModeChecker extends AbstractAttributeChecker { /** - * @param array|string $rateMode - * - * @return Mode + * @param array|string $rateMod */ public function create($rateMode): \Mhor\MediaInfo\Attribute\Mode { diff --git a/src/Checker/RateChecker.php b/src/Checker/RateChecker.php index e888d45..ab71c2b 100644 --- a/src/Checker/RateChecker.php +++ b/src/Checker/RateChecker.php @@ -8,8 +8,6 @@ class RateChecker extends AbstractAttributeChecker { /** * @param array $value - * - * @return Rate */ public function create($value): \Mhor\MediaInfo\Attribute\Rate { diff --git a/src/Checker/RatioChecker.php b/src/Checker/RatioChecker.php index 291235c..ce1e312 100644 --- a/src/Checker/RatioChecker.php +++ b/src/Checker/RatioChecker.php @@ -8,8 +8,6 @@ class RatioChecker extends AbstractAttributeChecker { /** * @param array $value - * - * @return Ratio */ public function create($value): \Mhor\MediaInfo\Attribute\Ratio { diff --git a/src/Checker/SizeChecker.php b/src/Checker/SizeChecker.php index e3bc6be..117320a 100644 --- a/src/Checker/SizeChecker.php +++ b/src/Checker/SizeChecker.php @@ -8,8 +8,6 @@ class SizeChecker extends AbstractAttributeChecker { /** * @param array $sizes - * - * @return Size */ public function create($sizes): \Mhor\MediaInfo\Attribute\Size { diff --git a/src/Container/MediaInfoContainer.php b/src/Container/MediaInfoContainer.php index 41d84bf..701b452 100644 --- a/src/Container/MediaInfoContainer.php +++ b/src/Container/MediaInfoContainer.php @@ -24,49 +24,40 @@ class MediaInfoContainer implements \JsonSerializable public const MENU_CLASS = 'Mhor\MediaInfo\Type\Menu'; public const OTHER_CLASS = 'Mhor\MediaInfo\Type\Other'; - /** - * @var string - */ - private $version; + private ?string $version = null; - /** - * @var General - */ - private $general; + private ?General $general = null; /** * @var Audio[] */ - private $audios = []; + private array $audios = []; /** * @var Video[] */ - private $videos = []; + private array $videos = []; /** * @var Subtitle[] */ - private $subtitles = []; + private array $subtitles = []; /** * @var Image[] */ - private $images = []; + private array $images = []; /** * @var Menu[] */ - private $menus = []; + private array $menus = []; /** * @var Other[] */ - private $others = []; + private array $others = []; - /** - * @return General|null - */ public function getGeneral(): ?General { return $this->general; @@ -107,14 +98,11 @@ public function getOthers(): array /** * @param string $version */ - public function setVersion($version): void + public function setVersion(?string $version): void { $this->version = $version; } - /** - * @return string|null - */ public function getVersion(): ?string { return $this->version; @@ -136,17 +124,12 @@ public function getSubtitles(): array return $this->subtitles; } - /** - * @param General $general - */ - public function setGeneral($general): void + public function setGeneral(General $general): void { $this->general = $general; } /** - * @param AbstractType $trackType - * * @throws \Exception */ public function add(AbstractType $trackType): void @@ -178,49 +161,31 @@ public function add(AbstractType $trackType): void } } - /** - * @param Audio $audio - */ private function addAudio(Audio $audio): void { $this->audios[] = $audio; } - /** - * @param Video $video - */ private function addVideo(Video $video): void { $this->videos[] = $video; } - /** - * @param Image $image - */ private function addImage(Image $image): void { $this->images[] = $image; } - /** - * @param Subtitle $subtitle - */ private function addSubtitle(Subtitle $subtitle): void { $this->subtitles[] = $subtitle; } - /** - * @param Menu $menu - */ private function addMenu(Menu $menu): void { $this->menus[] = $menu; } - /** - * @param Other $other - */ private function addOther(Other $other): void { $this->others[] = $other; diff --git a/src/DumpTrait.php b/src/DumpTrait.php index 8f3652c..76570f3 100644 --- a/src/DumpTrait.php +++ b/src/DumpTrait.php @@ -6,8 +6,6 @@ trait DumpTrait { /** * Convert the object into json. - * - * @return array */ public function jsonSerialize(): array { @@ -16,8 +14,6 @@ public function jsonSerialize(): array /** * Dump object to array. - * - * @return array */ public function __toArray(): array { diff --git a/src/Exception/MediainfoOutputParsingException.php b/src/Exception/MediainfoOutputParsingException.php index e2e681b..ae2ada0 100644 --- a/src/Exception/MediainfoOutputParsingException.php +++ b/src/Exception/MediainfoOutputParsingException.php @@ -4,9 +4,6 @@ class MediainfoOutputParsingException extends \Exception { - /** - * @param string $message - */ public function __construct(string $message) { parent::__construct($message); diff --git a/src/Exception/UnknownTrackTypeException.php b/src/Exception/UnknownTrackTypeException.php index 1af5196..f94850b 100644 --- a/src/Exception/UnknownTrackTypeException.php +++ b/src/Exception/UnknownTrackTypeException.php @@ -4,25 +4,15 @@ class UnknownTrackTypeException extends \Exception { - /** - * @var null|string - */ - private $trackType = null; + private string $trackType; - /** - * @param string $trackType - * @param int $code - */ public function __construct(string $trackType, $code = 0) { parent::__construct(sprintf('Type doesn\'t exist: %s', $trackType), $code, null); $this->trackType = $trackType; } - /** - * @return null|string - */ - public function getTrackType() + public function getTrackType(): string { return $this->trackType; } diff --git a/src/Factory/AttributeFactory.php b/src/Factory/AttributeFactory.php index 0a713bb..f62c53f 100644 --- a/src/Factory/AttributeFactory.php +++ b/src/Factory/AttributeFactory.php @@ -18,12 +18,9 @@ class AttributeFactory /** * @var AttributeCheckerInterface[] */ - private $attributeCheckers; + private array $attributeCheckers; - /** - * @param array|null $attributeCheckers - */ - public function __construct(array $attributeCheckers = null) + public function __construct(?array $attributeCheckers = null) { if (null === $attributeCheckers) { $attributeCheckers = $this->getDefaultAttributeCheckers(); @@ -33,8 +30,8 @@ public function __construct(array $attributeCheckers = null) } /** - * @param $attribute - * @param $value + * @param mixed $attribute + * @param mixed $value * * @return mixed */ diff --git a/src/Factory/TypeFactory.php b/src/Factory/TypeFactory.php index 452c9e2..c6c98b9 100644 --- a/src/Factory/TypeFactory.php +++ b/src/Factory/TypeFactory.php @@ -16,13 +16,9 @@ class TypeFactory public const OTHER = 'Other'; /** - * @param string $type - * * @throws \Mhor\MediaInfo\Exception\UnknownTrackTypeException - * - * @return Type\AbstractType */ - public function create($type): Type\AbstractType + public function create(string $type): Type\AbstractType { switch ($type) { case self::AUDIO: diff --git a/src/MediaInfo.php b/src/MediaInfo.php index 5a172e6..e886525 100644 --- a/src/MediaInfo.php +++ b/src/MediaInfo.php @@ -9,15 +9,9 @@ class MediaInfo { - /** - * @var MediaInfoCommandRunner|null - */ - private $mediaInfoCommandRunnerAsync = null; + private ?MediaInfoCommandRunner $mediaInfoCommandRunnerAsync = null; - /** - * @var array - */ - private $configuration = [ + private array $configuration = [ 'command' => null, 'use_oldxml_mediainfo_output_format' => true, 'urlencode' => false, @@ -55,8 +49,6 @@ public function getInfo(string $filePath, bool $ignoreUnknownTrackTypes = false) * Call to start asynchronous process. * * Make call to MediaInfo::getInfoWaitAsync() afterwards to received MediaInfoContainer object. - * - * @param string $filePath */ public function getInfoStartAsync(string $filePath): void { @@ -98,12 +90,11 @@ public function getInfoWaitAsync(bool $ignoreUnknownTrackTypes = false): MediaIn } /** - * @param string $key * @param mixed $value * * @throws \Exception */ - public function setConfig(string $key, $value) + public function setConfig(string $key, $value): void { if (!array_key_exists($key, $this->configuration)) { throw new \Exception( @@ -115,11 +106,9 @@ public function setConfig(string $key, $value) } /** - * @param string $key + * @return mixed * * @throws \Exception - * - * @return mixed */ public function getConfig(string $key) { diff --git a/src/Parser/MediaInfoOutputParser.php b/src/Parser/MediaInfoOutputParser.php index 723d9c8..949fba6 100644 --- a/src/Parser/MediaInfoOutputParser.php +++ b/src/Parser/MediaInfoOutputParser.php @@ -9,24 +9,13 @@ class MediaInfoOutputParser extends AbstractXmlOutputParser { - /** - * @var array - */ - private $parsedOutput; - - /** - * @param string $output - */ + private ?array $parsedOutput = null; + public function parse(string $output): void { $this->parsedOutput = $this->transformXmlToArray($output); } - /** - * @param array $configuration - * - * @return MediaInfoContainer - */ public function getMediaInfoContainer(array $configuration): \Mhor\MediaInfo\Container\MediaInfoContainer { if ($this->parsedOutput === null) { diff --git a/src/Parser/OutputParserInterface.php b/src/Parser/OutputParserInterface.php index 049b31b..cd0ab58 100644 --- a/src/Parser/OutputParserInterface.php +++ b/src/Parser/OutputParserInterface.php @@ -6,13 +6,7 @@ interface OutputParserInterface { - /** - * @param string $output - */ - public function parse(string $output); + public function parse(string $output): void; - /** - * @return MediaInfoContainer - */ - public function getMediaInfoContainer(array $configuration): \Mhor\MediaInfo\Container\MediaInfoContainer; + public function getMediaInfoContainer(array $configuration): MediaInfoContainer; } diff --git a/src/Runner/MediaInfoCommandRunner.php b/src/Runner/MediaInfoCommandRunner.php index b73ebce..c1f2c13 100644 --- a/src/Runner/MediaInfoCommandRunner.php +++ b/src/Runner/MediaInfoCommandRunner.php @@ -13,14 +13,8 @@ class MediaInfoCommandRunner public const MEDIAINFO_URLENCODE = '--urlencode'; public const MEDIAINFO_INCLUDE_COVER_DATA = '--Cover_Data=base64'; - /** - * @var Process - */ - protected $process; + protected Process $process; - /** - * @param Process $process - */ public function __construct(Process $process) { $this->process = $process; @@ -28,8 +22,6 @@ public function __construct(Process $process) /** * @throws \RuntimeException - * - * @return string */ public function run(): string { diff --git a/src/Type/AbstractType.php b/src/Type/AbstractType.php index c8e2485..6508ed6 100644 --- a/src/Type/AbstractType.php +++ b/src/Type/AbstractType.php @@ -8,28 +8,18 @@ abstract class AbstractType implements \JsonSerializable { use DumpTrait; - /** - * @var array - */ - protected $attributes = []; + protected array $attributes = []; /** * @param $attribute * @param string|object $value - * - * @return string */ public function set($attribute, $value): void { $this->attributes[$attribute] = $value; } - /** - * @param string $attribute - * - * @return mixed - */ - public function get(string $attribute = null) + public function get(?string $attribute = null) { if ($attribute === null) { return $this->attributes; @@ -42,11 +32,6 @@ public function get(string $attribute = null) return null; } - /** - * @param string $attribute - * - * @return bool - */ public function has(string $attribute): bool { if (isset($this->attributes[$attribute])) { @@ -56,9 +41,6 @@ public function has(string $attribute): bool return false; } - /** - * @return array - */ public function list(): array { return array_keys($this->attributes); @@ -66,8 +48,6 @@ public function list(): array /** * Convert the object into json. - * - * @return array */ public function jsonSerialize(): array { @@ -82,8 +62,6 @@ public function jsonSerialize(): array /** * Convert the object into array. - * - * @return array */ public function __toArray(): array {