summaryrefslogtreecommitdiffstats
path: root/php-laminas-cli-rpm.patch
diff options
context:
space:
mode:
Diffstat (limited to 'php-laminas-cli-rpm.patch')
-rw-r--r--php-laminas-cli-rpm.patch88
1 files changed, 88 insertions, 0 deletions
diff --git a/php-laminas-cli-rpm.patch b/php-laminas-cli-rpm.patch
new file mode 100644
index 0000000..cea2e75
--- /dev/null
+++ b/php-laminas-cli-rpm.patch
@@ -0,0 +1,88 @@
+diff -up ./src/ApplicationFactory.php.rpm ./src/ApplicationFactory.php
+--- ./src/ApplicationFactory.php.rpm 2021-09-30 10:42:36.170299767 +0200
++++ ./src/ApplicationFactory.php 2021-09-30 10:43:04.214217583 +0200
+@@ -4,7 +4,6 @@ declare(strict_types=1);
+
+ namespace Laminas\Cli;
+
+-use PackageVersions\Versions;
+ use Symfony\Component\Console\Application;
+ use Symfony\Component\Console\Input\InputOption;
+ use Webmozart\Assert\Assert;
+@@ -25,7 +24,7 @@ final class ApplicationFactory
+ public function __invoke(): Application
+ {
+ /** @psalm-suppress DeprecatedClass */
+- $version = strstr(Versions::getVersion('laminas/laminas-cli'), '@', true);
++ $version = '@VERSION@';
+ Assert::string($version);
+ $application = new Application('laminas', $version);
+ $application->setAutoExit(false);
+diff -up ./src/Command/AbstractParamAwareCommand.php.rpm ./src/Command/AbstractParamAwareCommand.php
+--- ./src/Command/AbstractParamAwareCommand.php.rpm 2021-09-30 10:42:33.546307457 +0200
++++ ./src/Command/AbstractParamAwareCommand.php 2021-09-30 10:42:58.841233330 +0200
+@@ -10,7 +10,6 @@ use Laminas\Cli\Input\InputParamInterfac
+ use Laminas\Cli\Input\NonHintedParamAwareInput;
+ use Laminas\Cli\Input\ParamAwareInputInterface;
+ use Laminas\Cli\Input\TypeHintedParamAwareInput;
+-use PackageVersions\Versions;
+ use RuntimeException;
+ use Symfony\Component\Console\Command\Command;
+ use Symfony\Component\Console\Helper\HelperSet;
+@@ -91,11 +90,7 @@ abstract class AbstractParamAwareCommand
+ return $input;
+ }
+
+- /** @psalm-suppress DeprecatedClass */
+- $consoleVersion = strstr(Versions::getVersion('symfony/console'), '@', true);
+- Assert::string($consoleVersion);
+-
+- $inputDecoratorClass = str_replace('v', '', $consoleVersion) >= '5.0.0'
++ $inputDecoratorClass = false /* Symfony < 5.0 */
+ ? TypeHintedParamAwareInput::class
+ : NonHintedParamAwareInput::class;
+
+diff -up ./test/Command/ParamAwareCommandTest.php.rpm ./test/Command/ParamAwareCommandTest.php
+--- ./test/Command/ParamAwareCommandTest.php.rpm 2021-09-30 10:42:40.802286197 +0200
++++ ./test/Command/ParamAwareCommandTest.php 2021-09-30 10:42:47.139267624 +0200
+@@ -8,7 +8,6 @@ use Laminas\Cli\Input\BoolParam;
+ use Laminas\Cli\Input\ParamAwareInputInterface;
+ use LaminasTest\Cli\TestAsset\ParamAwareCommandStub;
+ use LaminasTest\Cli\TestAsset\ParamAwareCommandStubNonHinted;
+-use PackageVersions\Versions;
+ use PHPUnit\Framework\MockObject\MockObject;
+ use PHPUnit\Framework\TestCase;
+ use Symfony\Component\Console\Helper\HelperSet;
+@@ -44,9 +43,7 @@ class ParamAwareCommandTest extends Test
+ )
+ ->willReturn($this->questionHelper);
+
+- /** @psalm-suppress DeprecatedClass */
+- $consoleVersion = strstr(Versions::getVersion('symfony/console'), '@', true) ?: '';
+- $commandClass = str_replace('v', '', $consoleVersion) >= '5.0.0'
++ $commandClass = false /* Symfony < 5.0 */
+ ? ParamAwareCommandStub::class
+ : ParamAwareCommandStubNonHinted::class;
+
+diff -up ./test/Input/ParamAwareInputTest.php.rpm ./test/Input/ParamAwareInputTest.php
+--- ./test/Input/ParamAwareInputTest.php.rpm 2021-09-30 10:42:38.426293159 +0200
++++ ./test/Input/ParamAwareInputTest.php 2021-09-30 10:42:52.938250628 +0200
+@@ -13,7 +13,6 @@ use Laminas\Cli\Input\NonHintedParamAwar
+ use Laminas\Cli\Input\PathParam;
+ use Laminas\Cli\Input\StringParam;
+ use Laminas\Cli\Input\TypeHintedParamAwareInput;
+-use PackageVersions\Versions;
+ use PHPUnit\Framework\MockObject\MockObject;
+ use PHPUnit\Framework\TestCase;
+ use Symfony\Component\Console\Formatter\NullOutputFormatter;
+@@ -67,9 +66,7 @@ class ParamAwareInputTest extends TestCa
+
+ public function setUp(): void
+ {
+- /** @psalm-suppress DeprecatedClass */
+- $consoleVersion = strstr(Versions::getVersion('symfony/console'), '@', true) ?: '';
+- $this->class = str_replace('v', '', $consoleVersion) >= '5.0.0'
++ $this->class = false /* Symfony < 5.0 */
+ ? TypeHintedParamAwareInput::class
+ : NonHintedParamAwareInput::class;
+