Skip to content

Commit edbe37b

Browse files
committed
release PHP 7.2 downgraded
1 parent 8d4fc84 commit edbe37b

File tree

179 files changed

+513
-2923
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

179 files changed

+513
-2923
lines changed

.github/FUNDING.yml

-3
This file was deleted.

.github/workflows/code_analysis.yaml

-53
This file was deleted.

.github/workflows/downgraded_release.yaml

-49
This file was deleted.

.github/workflows/rector.yaml

-35
This file was deleted.

.github/workflows/various_php_install.yaml

-30
This file was deleted.

build/composer-php-72.json

-24
This file was deleted.

build/rector-downgrade-php-72.php

-10
This file was deleted.

composer.json

+2-34
Original file line numberDiff line numberDiff line change
@@ -5,47 +5,15 @@
55
"license": "MIT",
66
"keywords": ["static analysis", "phpstan-extension"],
77
"require": {
8-
"php": "^8.2",
9-
"phpstan/phpstan": "^1.10",
8+
"php": "^7.2 || ^8.0",
9+
"phpstan/phpstan": "^1.10.19",
1010
"webmozart/assert": "^1.11"
1111
},
12-
"require-dev": {
13-
"phpstan/extension-installer": "^1.3",
14-
"tracy/tracy": "^2.10",
15-
"symplify/easy-coding-standard": "^12.1",
16-
"rector/rector": "^1.0",
17-
"phpunit/phpunit": "^10.5",
18-
"tomasvotruba/class-leak": "^0.2.11",
19-
"tomasvotruba/cognitive-complexity": "^0.2.2",
20-
"tomasvotruba/type-coverage": "^0.2",
21-
"symplify/easy-ci": "^12.0",
22-
"nikic/php-parser": "^4.19"
23-
},
2412
"autoload": {
2513
"psr-4": {
2614
"TomasVotruba\\UnusedPublic\\": "src"
2715
}
2816
},
29-
"autoload-dev": {
30-
"psr-4": {
31-
"TomasVotruba\\UnusedPublic\\Tests\\": "tests"
32-
},
33-
"classmap": [
34-
"stubs"
35-
]
36-
},
37-
"scripts": {
38-
"check-cs": "vendor/bin/ecs check --ansi",
39-
"fix-cs": "vendor/bin/ecs check --fix --ansi",
40-
"phpstan": "vendor/bin/phpstan --ansi",
41-
"rector": "vendor/bin/rector --dry-run --ansi",
42-
"release": "vendor/bin/monorepo-builder release patch --ansi"
43-
},
44-
"config": {
45-
"allow-plugins": {
46-
"phpstan/extension-installer": true
47-
}
48-
},
4917
"extra": {
5018
"phpstan": {
5119
"includes": [

ecs.php

-14
This file was deleted.

phpstan.neon

-30
This file was deleted.

phpunit.xml

-12
This file was deleted.

src/ApiDocStmtAnalyzer.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public function isApiDoc(Stmt $stmt, ClassReflection $classReflection): bool
1515
{
1616
if ($classReflection->getResolvedPhpDoc() instanceof ResolvedPhpDocBlock) {
1717
$resolvedPhpDoc = $classReflection->getResolvedPhpDoc();
18-
if (str_contains($resolvedPhpDoc->getPhpDocString(), '@api')) {
18+
if (strpos($resolvedPhpDoc->getPhpDocString(), '@api') !== false) {
1919
return true;
2020
}
2121
}
@@ -30,6 +30,6 @@ public function isApiDoc(Stmt $stmt, ClassReflection $classReflection): bool
3030

3131
public function isApiDocComment(string $docComment): bool
3232
{
33-
return str_contains($docComment, '@api');
33+
return strpos($docComment, '@api') !== false;
3434
}
3535
}

src/CallReferece/ParentCallReferenceResolver.php

+10-4
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,17 @@
66

77
use PHPStan\Reflection\ReflectionProvider;
88

9-
final readonly class ParentCallReferenceResolver
9+
final class ParentCallReferenceResolver
1010
{
11-
public function __construct(
12-
private ReflectionProvider $reflectionProvider,
13-
) {
11+
/**
12+
* @readonly
13+
* @var \PHPStan\Reflection\ReflectionProvider
14+
*/
15+
private $reflectionProvider;
16+
17+
public function __construct(ReflectionProvider $reflectionProvider)
18+
{
19+
$this->reflectionProvider = $reflectionProvider;
1420
}
1521

1622
/**

src/CollectorMapper/MethodCallCollectorMapper.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public function mapToMethodCallReferences(array $nestedReferencesByFiles): array
2020

2121
// remove ReferenceMaker::LOCAL prefix
2222
return array_map(static function (string $methodCallReference): string {
23-
if (str_starts_with($methodCallReference, ReferenceMarker::LOCAL)) {
23+
if (strncmp($methodCallReference, ReferenceMarker::LOCAL, strlen(ReferenceMarker::LOCAL)) === 0) {
2424
return substr($methodCallReference, strlen(ReferenceMarker::LOCAL));
2525
}
2626

@@ -39,7 +39,7 @@ public function mapToLocalAndExternal(array $nestedReferencesByFiles): LocalAndE
3939
$externalMethodCallReferences = [];
4040

4141
foreach ($methodCallReferences as $methodCallReference) {
42-
if (str_starts_with($methodCallReference, ReferenceMarker::LOCAL)) {
42+
if (strncmp($methodCallReference, ReferenceMarker::LOCAL, strlen(ReferenceMarker::LOCAL)) === 0) {
4343
$localMethodCallReferences[] = substr($methodCallReference, strlen(ReferenceMarker::LOCAL));
4444
} else {
4545
$externalMethodCallReferences[] = $methodCallReference;

src/Collectors/Callable_/AttributeCallableCollector.php

+10-4
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,17 @@
1919
/**
2020
* @implements Collector<AttributeGroup, array<string>|null>
2121
*/
22-
final readonly class AttributeCallableCollector implements Collector
22+
final class AttributeCallableCollector implements Collector
2323
{
24-
public function __construct(
25-
private Configuration $configuration,
26-
) {
24+
/**
25+
* @readonly
26+
* @var \TomasVotruba\UnusedPublic\Configuration
27+
*/
28+
private $configuration;
29+
30+
public function __construct(Configuration $configuration)
31+
{
32+
$this->configuration = $configuration;
2733
}
2834

2935
public function getNodeType(): string

0 commit comments

Comments
 (0)