summaryrefslogtreecommitdiffstats
path: root/php-laminas-cli-rpm.patch
blob: cea2e758a9a8b900d38a71eaf7caf5a6b906333c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
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;