mirror of
https://github.com/php/pie.git
synced 2026-03-23 23:12:17 +01:00
435: add phpstan-phpunit extension
This commit is contained in:
@@ -46,6 +46,7 @@
|
|||||||
"bnf/phpstan-psr-container": "^1.1",
|
"bnf/phpstan-psr-container": "^1.1",
|
||||||
"doctrine/coding-standard": "^14.0.0",
|
"doctrine/coding-standard": "^14.0.0",
|
||||||
"phpstan/phpstan": "^2.1.38",
|
"phpstan/phpstan": "^2.1.38",
|
||||||
|
"phpstan/phpstan-phpunit": "^2.0",
|
||||||
"phpstan/phpstan-webmozart-assert": "^2.0",
|
"phpstan/phpstan-webmozart-assert": "^2.0",
|
||||||
"phpunit/phpunit": "^10.5.63"
|
"phpunit/phpunit": "^10.5.63"
|
||||||
},
|
},
|
||||||
|
|||||||
58
composer.lock
generated
58
composer.lock
generated
@@ -4,7 +4,7 @@
|
|||||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||||
"This file is @generated automatically"
|
"This file is @generated automatically"
|
||||||
],
|
],
|
||||||
"content-hash": "6392877b0b53e6d18d3d156173dcbba3",
|
"content-hash": "1138a5a4004fa55c3068062f3a2adc43",
|
||||||
"packages": [
|
"packages": [
|
||||||
{
|
{
|
||||||
"name": "composer/ca-bundle",
|
"name": "composer/ca-bundle",
|
||||||
@@ -3362,6 +3362,62 @@
|
|||||||
],
|
],
|
||||||
"time": "2026-01-30T17:12:46+00:00"
|
"time": "2026-01-30T17:12:46+00:00"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "phpstan/phpstan-phpunit",
|
||||||
|
"version": "2.0.16",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/phpstan/phpstan-phpunit.git",
|
||||||
|
"reference": "6ab598e1bc106e6827fd346ae4a12b4a5d634c32"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/phpstan/phpstan-phpunit/zipball/6ab598e1bc106e6827fd346ae4a12b4a5d634c32",
|
||||||
|
"reference": "6ab598e1bc106e6827fd346ae4a12b4a5d634c32",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"php": "^7.4 || ^8.0",
|
||||||
|
"phpstan/phpstan": "^2.1.32"
|
||||||
|
},
|
||||||
|
"conflict": {
|
||||||
|
"phpunit/phpunit": "<7.0"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"nikic/php-parser": "^5",
|
||||||
|
"php-parallel-lint/php-parallel-lint": "^1.2",
|
||||||
|
"phpstan/phpstan-deprecation-rules": "^2.0",
|
||||||
|
"phpstan/phpstan-strict-rules": "^2.0",
|
||||||
|
"phpunit/phpunit": "^9.6"
|
||||||
|
},
|
||||||
|
"type": "phpstan-extension",
|
||||||
|
"extra": {
|
||||||
|
"phpstan": {
|
||||||
|
"includes": [
|
||||||
|
"extension.neon",
|
||||||
|
"rules.neon"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"PHPStan\\": "src/"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"description": "PHPUnit extensions and rules for PHPStan",
|
||||||
|
"keywords": [
|
||||||
|
"static analysis"
|
||||||
|
],
|
||||||
|
"support": {
|
||||||
|
"issues": "https://github.com/phpstan/phpstan-phpunit/issues",
|
||||||
|
"source": "https://github.com/phpstan/phpstan-phpunit/tree/2.0.16"
|
||||||
|
},
|
||||||
|
"time": "2026-02-14T09:05:21+00:00"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "phpstan/phpstan-webmozart-assert",
|
"name": "phpstan/phpstan-webmozart-assert",
|
||||||
"version": "2.0.0",
|
"version": "2.0.0",
|
||||||
|
|||||||
@@ -360,18 +360,6 @@ parameters:
|
|||||||
count: 1
|
count: 1
|
||||||
path: test/integration/Command/InstallCommandTest.php
|
path: test/integration/Command/InstallCommandTest.php
|
||||||
|
|
||||||
-
|
|
||||||
message: '#^Parameter \#1 \$originalClassName of method PHPUnit\\Framework\\TestCase\:\:createMock\(\) expects class\-string\<object\>, string given\.$#'
|
|
||||||
identifier: argument.type
|
|
||||||
count: 1
|
|
||||||
path: test/integration/Command/InstallExtensionsForProjectCommandTest.php
|
|
||||||
|
|
||||||
-
|
|
||||||
message: '#^Unable to resolve the template type RealInstanceType in call to method PHPUnit\\Framework\\TestCase\:\:createMock\(\)$#'
|
|
||||||
identifier: argument.templateType
|
|
||||||
count: 1
|
|
||||||
path: test/integration/Command/InstallExtensionsForProjectCommandTest.php
|
|
||||||
|
|
||||||
-
|
-
|
||||||
message: '#^Call to function assert\(\) with true will always evaluate to true\.$#'
|
message: '#^Call to function assert\(\) with true will always evaluate to true\.$#'
|
||||||
identifier: function.alreadyNarrowedType
|
identifier: function.alreadyNarrowedType
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ includes:
|
|||||||
- phpstan-baseline.neon
|
- phpstan-baseline.neon
|
||||||
- vendor/bnf/phpstan-psr-container/extension.neon
|
- vendor/bnf/phpstan-psr-container/extension.neon
|
||||||
- vendor/phpstan/phpstan-webmozart-assert/extension.neon
|
- vendor/phpstan/phpstan-webmozart-assert/extension.neon
|
||||||
|
- vendor/phpstan/phpstan-phpunit/extension.neon
|
||||||
|
|
||||||
parameters:
|
parameters:
|
||||||
level: 10
|
level: 10
|
||||||
|
|||||||
@@ -58,17 +58,15 @@ final class InstallExtensionsForProjectCommandTest extends TestCase
|
|||||||
$container->method('get')->willReturnCallback(
|
$container->method('get')->willReturnCallback(
|
||||||
/** @param class-string $service */
|
/** @param class-string $service */
|
||||||
function (string $service): mixed {
|
function (string $service): mixed {
|
||||||
switch ($service) {
|
/** @var class-string $service */
|
||||||
case QuieterConsoleIO::class:
|
return match ($service) {
|
||||||
return new QuieterConsoleIO(
|
QuieterConsoleIO::class => new QuieterConsoleIO(
|
||||||
new ArrayInput([]),
|
new ArrayInput([]),
|
||||||
new BufferedOutput(),
|
new BufferedOutput(),
|
||||||
new MinimalHelperSet(['question' => new QuestionHelper()]),
|
new MinimalHelperSet(['question' => new QuestionHelper()]),
|
||||||
);
|
),
|
||||||
|
default => $this->createMock($service),
|
||||||
default:
|
};
|
||||||
return $this->createMock($service);
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -43,7 +43,6 @@ final class FetchDependencyStatusesTest extends TestCase
|
|||||||
$package,
|
$package,
|
||||||
);
|
);
|
||||||
|
|
||||||
self::assertIsList($deps);
|
|
||||||
self::assertCount(3, $deps);
|
self::assertCount(3, $deps);
|
||||||
|
|
||||||
self::assertSame('ext-core: == 8.4.17.0 ✅', $deps[0]->asPrettyString());
|
self::assertSame('ext-core: == 8.4.17.0 ✅', $deps[0]->asPrettyString());
|
||||||
|
|||||||
@@ -400,10 +400,8 @@ final class PhpBinaryPathTest extends TestCase
|
|||||||
$php = PhpBinaryPath::fromPhpBinaryPath($phpPath);
|
$php = PhpBinaryPath::fromPhpBinaryPath($phpPath);
|
||||||
self::assertArrayHasKey('Core', $php->extensions());
|
self::assertArrayHasKey('Core', $php->extensions());
|
||||||
self::assertNotEmpty($php->extensionPath());
|
self::assertNotEmpty($php->extensionPath());
|
||||||
self::assertInstanceOf(OperatingSystem::class, $php->operatingSystem());
|
|
||||||
self::assertNotEmpty($php->version());
|
self::assertNotEmpty($php->version());
|
||||||
self::assertNotEmpty($php->majorMinorVersion());
|
self::assertNotEmpty($php->majorMinorVersion());
|
||||||
self::assertInstanceOf(Architecture::class, $php->machineType());
|
|
||||||
self::assertGreaterThan(0, $php->phpIntSize());
|
self::assertGreaterThan(0, $php->phpIntSize());
|
||||||
self::assertNotEmpty($php->phpinfo());
|
self::assertNotEmpty($php->phpinfo());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user