Skip to content

Commit

Permalink
Fix build issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Seldaek committed Jun 24, 2024
1 parent d950783 commit 86d774d
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 14 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@
/CHANGELOG.md export-ignore
/CONTRIBUTING.md export-ignore
/README.md export-ignore
/phpstan-baseline.neon export-ignore
/phpstan.neon.dist export-ignore
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,12 @@
"composer-plugin-api": "^1.0 || ^2.0"
},
"require-dev": {
"composer/composer": "1.6.* || ^2.0",
"composer/semver": "^1 || ^3",
"composer/composer": "^1.10.27 || ^2.7",
"composer/semver": "^1.7.2 || ^3.4.0",
"symfony/phpunit-bridge": "^5.3",
"phpstan/phpstan": "^0.12.55",
"symfony/process": "^5",
"phpstan/phpstan-phpunit": "^0.12.16"
"phpstan/phpstan": "^1.11",
"symfony/process": "^5 || ^6 || ^7",
"phpstan/phpstan-phpunit": "^1"
},
"scripts": {
"test": "vendor/bin/simple-phpunit",
Expand Down
6 changes: 6 additions & 0 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
parameters:
ignoreErrors:
-
message: "#^Unsafe access to private property Composer\\\\Installers\\\\BitrixInstaller\\:\\:\\$checkedDuplicates through static\\:\\:\\.$#"
count: 2
path: src/Composer/Installers/BitrixInstaller.php
2 changes: 1 addition & 1 deletion src/Composer/Installers/CakePHPInstaller.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public function getLocations(string $frameworkType): array
/**
* Check if CakePHP version matches against a version
*
* @phpstan-param Constraint::STR_OP_* $matcher
* @phpstan-param '='|'=='|'<'|'<='|'>'|'>='|'<>'|'!=' $matcher
*/
protected function matchesCakeVersion(string $matcher, string $version): bool
{
Expand Down
5 changes: 5 additions & 0 deletions src/Composer/Installers/Installer.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,9 @@ public function getInstallPath(PackageInterface $package)
}

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

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

/**
* {@inheritDoc}
*
* @param string $packageType
*/
public function supports($packageType)
{
Expand Down
5 changes: 3 additions & 2 deletions tests/Composer/Installers/Test/InstallerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use Composer\Util\Filesystem;
use Composer\Repository\InstalledRepositoryInterface;
use Composer\IO\IOInterface;
use PHPUnit\Framework\MockObject\MockObject;

class InstallerTest extends TestCase
{
Expand All @@ -21,7 +22,7 @@ class InstallerTest extends TestCase
private $vendorDir;
/** @var string */
private $binDir;
/** @var InstalledRepositoryInterface */
/** @var InstalledRepositoryInterface&MockObject */
private $repository;
/** @var IOInterface */
private $io;
Expand Down Expand Up @@ -564,7 +565,7 @@ public function testUninstallAndDeletePackageFromLocalRepo(): void
$installer->expects($this->atLeastOnce())->method('getInstallPath')->with($package)->will($this->returnValue(sys_get_temp_dir().'/foo'));
$installer->expects($this->atLeastOnce())->method('removeCode')->with($package)->will($this->returnValue(null));

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

Expand Down
5 changes: 0 additions & 5 deletions tests/Composer/Installers/Test/MauticInstallerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@

class MauticInstallerTest extends TestCase
{
/**
* @var MauticInstaller
*/
private $installer;

/**
* @var Composer
*/
Expand Down
2 changes: 1 addition & 1 deletion tests/Composer/Installers/Test/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ protected static function getVersionParser(): VersionParser
}

/**
* @param Constraint::STR_OP_* $operator
* @phpstan-param '='|'=='|'<'|'<='|'>'|'>='|'<>'|'!=' $operator
*/
protected function getVersionConstraint(string $operator, string $version): Constraint
{
Expand Down

0 comments on commit 86d774d

Please sign in to comment.