Skip to content

Commit

Permalink
Merge branch 'master' of github.com:PHP-FFMpeg/PHP-FFMpeg
Browse files Browse the repository at this point in the history
# Conflicts:
#	composer.json
  • Loading branch information
deluxetom committed Jan 13, 2025
2 parents 8189e98 + 0fbbc4c commit 7ca2db4
Show file tree
Hide file tree
Showing 17 changed files with 27 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
fail-fast: true
matrix:
os: [ubuntu-20.04]
php: [8.3, 8.2, 8.1, 8.0]
php: [8.4, 8.3, 8.2, 8.1, 8.0]
ffmpeg: [5.0, 4.4]
dependency-version: [prefer-lowest, prefer-stable]

Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
}
],
"require": {
"php": ">=8.0",
"php": "^8.0 || ^8.1 || ^8.2 || ^8.3 || ^8.4",
"evenement/evenement": "^3.0",
"psr/log": "^1.0 || ^2.0 || ^3.0",
"spatie/temporary-directory": "^2.0",
Expand All @@ -57,7 +57,7 @@
"php-ffmpeg/extras": "A compilation of common audio & video drivers for PHP-FFMpeg"
},
"require-dev": {
"phpunit/phpunit": "^9.5.10",
"phpunit/phpunit": "^9.5.10 || ^10.0",
"mockery/mockery": "^1.5"
},
"autoload": {
Expand All @@ -72,4 +72,4 @@
"Tests\\FFMpeg\\": "tests/FFMpeg"
}
}
}
}
2 changes: 1 addition & 1 deletion src/Alchemy/BinaryDriver/AbstractBinary.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ public function command($command, $bypassErrors = false, $listeners = null)
/**
* {@inheritdoc}
*/
public static function load($binaries, LoggerInterface $logger = null, $configuration = array())
public static function load($binaries, ?LoggerInterface $logger = null, $configuration = array())
{
$finder = new ExecutableFinder();
$binary = null;
Expand Down
2 changes: 1 addition & 1 deletion src/Alchemy/BinaryDriver/BinaryInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,5 @@ public function command($command, $bypassErrors = false, $listeners = null);
*
* @return BinaryInterface
*/
public static function load($binaries, LoggerInterface $logger = null, $configuration = array());
public static function load($binaries, ?LoggerInterface $logger = null, $configuration = array());
}
2 changes: 1 addition & 1 deletion src/Alchemy/BinaryDriver/Listeners/Listeners.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function __clone()
*
* @return ListenersInterface
*/
public function register(ListenerInterface $listener, EventEmitter $target = null)
public function register(ListenerInterface $listener, ?EventEmitter $target = null)
{
$EElisteners = array();

Expand Down
2 changes: 1 addition & 1 deletion src/Alchemy/BinaryDriver/ProcessRunner.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ private function buildCallback(SplObjectStorage $listeners)
};
}

private function doExecutionFailure($command, $errorOutput, \Exception $e = null)
private function doExecutionFailure($command, $errorOutput, ?\Exception $e = null)
{
$this->logger->error($this->createErrorMessage($command, $errorOutput));
throw new ExecutionFailureException(
Expand Down
2 changes: 1 addition & 1 deletion src/FFMpeg/Driver/FFMpegDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function getName(): string
*
* @return FFMpegDriver
*/
public static function create(LoggerInterface $logger = null, $configuration = [])
public static function create(?LoggerInterface $logger = null, $configuration = [])
{
if (!$configuration instanceof ConfigurationInterface) {
$configuration = new Configuration($configuration);
Expand Down
2 changes: 1 addition & 1 deletion src/FFMpeg/Driver/FFProbeDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function getName(): string
*
* @return FFProbeDriver
*/
public static function create($configuration, LoggerInterface $logger = null)
public static function create($configuration, ?LoggerInterface $logger = null)
{
if (!$configuration instanceof ConfigurationInterface) {
$configuration = new Configuration($configuration);
Expand Down
2 changes: 1 addition & 1 deletion src/FFMpeg/FFMpeg.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public function openAdvanced($inputs)
*
* @return FFMpeg
*/
public static function create($configuration = [], LoggerInterface $logger = null, FFProbe $probe = null)
public static function create($configuration = [], ?LoggerInterface $logger = null, ?FFProbe $probe = null)
{
if (null === $probe) {
$probe = FFProbe::create($configuration, $logger, null);
Expand Down
2 changes: 1 addition & 1 deletion src/FFMpeg/FFProbe.php
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ public function streams($pathfile)
*
* @return FFProbe
*/
public static function create($configuration = [], LoggerInterface $logger = null, CacheItemPoolInterface $cache = null)
public static function create($configuration = [], ?LoggerInterface $logger = null, ?CacheItemPoolInterface $cache = null)
{
if (null === $cache) {
$cache = new ArrayAdapter();
Expand Down
2 changes: 1 addition & 1 deletion src/FFMpeg/Filters/Audio/AudioClipFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class AudioClipFilter implements AudioFilterInterface
*/
private $priority;

public function __construct(TimeCode $start, TimeCode $duration = null, $priority = 0)
public function __construct(TimeCode $start, ?TimeCode $duration = null, $priority = 0)
{
$this->start = $start;
$this->duration = $duration;
Expand Down
2 changes: 1 addition & 1 deletion src/FFMpeg/Filters/Video/ClipFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class ClipFilter implements VideoFilterInterface
/** @var int */
private $priority;

public function __construct(TimeCode $start, TimeCode $duration = null, $priority = 0)
public function __construct(TimeCode $start, ?TimeCode $duration = null, $priority = 0)
{
$this->start = $start;
$this->duration = $duration;
Expand Down
2 changes: 1 addition & 1 deletion src/FFMpeg/Media/Clip.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class Clip extends Video
/** @var Video Parrent video */
private $video;

public function __construct(Video $video, FFMpegDriver $driver, FFProbe $ffprobe, TimeCode $start, TimeCode $duration = null)
public function __construct(Video $video, FFMpegDriver $driver, FFProbe $ffprobe, TimeCode $start, ?TimeCode $duration = null)
{
$this->start = $start;
$this->duration = $duration;
Expand Down
2 changes: 1 addition & 1 deletion src/FFMpeg/Media/Video.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public function concat($sources)
*
* @return \FFMpeg\Media\Clip
*/
public function clip(TimeCode $start, TimeCode $duration = null)
public function clip(TimeCode $start, ?TimeCode $duration = null)
{
return new Clip($this, $this->driver, $this->ffprobe, $start, $duration);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use PHPUnit\Framework\TestCase;
use Symfony\Component\Process\ExecutableFinder;

abstract class AbstractProcessBuilderFactoryTest extends TestCase
trait AbstractProcessBuilderFactoryTrait
{
public static $phpBinary;

Expand Down
6 changes: 5 additions & 1 deletion tests/Alchemy/BinaryDriver/LTSProcessBuilderFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@
namespace Alchemy\Tests\BinaryDriver;

use Alchemy\BinaryDriver\ProcessBuilderFactory;
use Alchemy\Tests\BinaryDriver\AbstractProcessBuilderFactoryTrait;
use Tests\FFMpeg\Unit\TestCase;

class LTSProcessBuilderFactoryTest extends AbstractProcessBuilderFactoryTest
class LTSProcessBuilderFactoryTest extends TestCase
{
use AbstractProcessBuilderFactoryTrait;

public function setUp(): void
{
if (!class_exists('Symfony\Component\Process\ProcessBuilder')) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@
namespace Alchemy\Tests\BinaryDriver;

use Alchemy\BinaryDriver\ProcessBuilderFactory;
use Alchemy\Tests\BinaryDriver\AbstractProcessBuilderFactoryTrait;
use Tests\FFMpeg\Unit\TestCase;

class NONLTSProcessBuilderFactoryTest extends AbstractProcessBuilderFactoryTest
class NONLTSProcessBuilderFactoryTest extends TestCase
{
use AbstractProcessBuilderFactoryTrait;

protected function getProcessBuilderFactory($binary)
{
ProcessBuilderFactory::$emulateSfLTS = true;
Expand Down

0 comments on commit 7ca2db4

Please sign in to comment.