Skip to content

Commit 86d774d

Browse files
committed
Fix build issues
1 parent d950783 commit 86d774d

File tree

8 files changed

+23
-14
lines changed

8 files changed

+23
-14
lines changed

.gitattributes

+2
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,5 @@
1010
/CHANGELOG.md export-ignore
1111
/CONTRIBUTING.md export-ignore
1212
/README.md export-ignore
13+
/phpstan-baseline.neon export-ignore
14+
/phpstan.neon.dist export-ignore

composer.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,12 @@
102102
"composer-plugin-api": "^1.0 || ^2.0"
103103
},
104104
"require-dev": {
105-
"composer/composer": "1.6.* || ^2.0",
106-
"composer/semver": "^1 || ^3",
105+
"composer/composer": "^1.10.27 || ^2.7",
106+
"composer/semver": "^1.7.2 || ^3.4.0",
107107
"symfony/phpunit-bridge": "^5.3",
108-
"phpstan/phpstan": "^0.12.55",
109-
"symfony/process": "^5",
110-
"phpstan/phpstan-phpunit": "^0.12.16"
108+
"phpstan/phpstan": "^1.11",
109+
"symfony/process": "^5 || ^6 || ^7",
110+
"phpstan/phpstan-phpunit": "^1"
111111
},
112112
"scripts": {
113113
"test": "vendor/bin/simple-phpunit",

phpstan-baseline.neon

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
parameters:
2+
ignoreErrors:
3+
-
4+
message: "#^Unsafe access to private property Composer\\\\Installers\\\\BitrixInstaller\\:\\:\\$checkedDuplicates through static\\:\\:\\.$#"
5+
count: 2
6+
path: src/Composer/Installers/BitrixInstaller.php

src/Composer/Installers/CakePHPInstaller.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public function getLocations(string $frameworkType): array
4646
/**
4747
* Check if CakePHP version matches against a version
4848
*
49-
* @phpstan-param Constraint::STR_OP_* $matcher
49+
* @phpstan-param '='|'=='|'<'|'<='|'>'|'>='|'<>'|'!=' $matcher
5050
*/
5151
protected function matchesCakeVersion(string $matcher, string $version): bool
5252
{

src/Composer/Installers/Installer.php

+5
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,9 @@ public function getInstallPath(PackageInterface $package)
146146
}
147147

148148
$class = 'Composer\\Installers\\' . $this->supportedTypes[$frameworkType];
149+
/**
150+
* @var BaseInstaller
151+
*/
149152
$installer = new $class($package, $this->composer, $this->getIO());
150153

151154
$path = $installer->getInstallPath($package, $frameworkType);
@@ -179,6 +182,8 @@ public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $
179182

180183
/**
181184
* {@inheritDoc}
185+
*
186+
* @param string $packageType
182187
*/
183188
public function supports($packageType)
184189
{

tests/Composer/Installers/Test/InstallerTest.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
use Composer\Util\Filesystem;
1111
use Composer\Repository\InstalledRepositoryInterface;
1212
use Composer\IO\IOInterface;
13+
use PHPUnit\Framework\MockObject\MockObject;
1314

1415
class InstallerTest extends TestCase
1516
{
@@ -21,7 +22,7 @@ class InstallerTest extends TestCase
2122
private $vendorDir;
2223
/** @var string */
2324
private $binDir;
24-
/** @var InstalledRepositoryInterface */
25+
/** @var InstalledRepositoryInterface&MockObject */
2526
private $repository;
2627
/** @var IOInterface */
2728
private $io;
@@ -564,7 +565,7 @@ public function testUninstallAndDeletePackageFromLocalRepo(): void
564565
$installer->expects($this->atLeastOnce())->method('getInstallPath')->with($package)->will($this->returnValue(sys_get_temp_dir().'/foo'));
565566
$installer->expects($this->atLeastOnce())->method('removeCode')->with($package)->will($this->returnValue(null));
566567

567-
$repo = $this->getMockBuilder(InstalledRepositoryInterface::class)->getMock();
568+
$repo = $this->repository;
568569
$repo->expects($this->once())->method('hasPackage')->with($package)->will($this->returnValue(true));
569570
$repo->expects($this->once())->method('removePackage')->with($package);
570571

tests/Composer/Installers/Test/MauticInstallerTest.php

-5
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,6 @@
88

99
class MauticInstallerTest extends TestCase
1010
{
11-
/**
12-
* @var MauticInstaller
13-
*/
14-
private $installer;
15-
1611
/**
1712
* @var Composer
1813
*/

tests/Composer/Installers/Test/TestCase.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ protected static function getVersionParser(): VersionParser
4141
}
4242

4343
/**
44-
* @param Constraint::STR_OP_* $operator
44+
* @phpstan-param '='|'=='|'<'|'<='|'>'|'>='|'<>'|'!=' $operator
4545
*/
4646
protected function getVersionConstraint(string $operator, string $version): Constraint
4747
{

0 commit comments

Comments
 (0)