Skip to content

Commit efd97d9

Browse files
committed
release PHP 7.2 downgraded
1 parent d4597d0 commit efd97d9

Some content is hidden

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

48 files changed

+140
-817
lines changed

.github/FUNDING.yml

-3
This file was deleted.

.github/workflows/code_analysis.yaml

-45
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

-28
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

+3-27
Original file line numberDiff line numberDiff line change
@@ -5,39 +5,15 @@
55
"license": "MIT",
66
"keywords": ["static analysis", "phpstan-extension"],
77
"require": {
8-
"php": "^8.2",
9-
"phpstan/phpstan": "^1.10.67"
10-
},
11-
"require-dev": {
12-
"phpstan/extension-installer": "^1.3",
13-
"phpunit/phpunit": "^10.5",
14-
"symplify/easy-coding-standard": "^12.1",
15-
"rector/rector": "^1.0.4",
16-
"tracy/tracy": "^2.10",
17-
"tomasvotruba/unused-public": "^0.2"
8+
"php": "^7.2 || ^8.0",
9+
"phpstan/phpstan": "^1.9.3",
10+
"nette/utils": "^3.2 || ^4.0"
1811
},
1912
"autoload": {
2013
"psr-4": {
2114
"TomasVotruba\\TypeCoverage\\": "src"
2215
}
2316
},
24-
"autoload-dev": {
25-
"psr-4": {
26-
"TomasVotruba\\TypeCoverage\\Tests\\": "tests"
27-
}
28-
},
29-
"scripts": {
30-
"check-cs": "vendor/bin/ecs check --ansi",
31-
"fix-cs": "vendor/bin/ecs check --fix --ansi",
32-
"phpstan": "vendor/bin/phpstan --ansi",
33-
"rector": "vendor/bin/rector --dry-run --ansi",
34-
"release": "vendor/bin/monorepo-builder release patch --ansi"
35-
},
36-
"config": {
37-
"allow-plugins": {
38-
"phpstan/extension-installer": true
39-
}
40-
},
4117
"extra": {
4218
"phpstan": {
4319
"includes": [

ecs.php

-9
This file was deleted.

phpstan.neon

-28
This file was deleted.

phpunit.xml

-12
This file was deleted.

src/Collectors/ParamTypeDeclarationCollector.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,6 @@ private function hasFunctionLikeCallableParam(FunctionLike $functionLike): bool
6767
}
6868

6969
$docCommentText = $docComment->getText();
70-
return str_contains($docCommentText, '@param callable');
70+
return strpos($docCommentText, '@param callable') !== false;
7171
}
7272
}

src/Collectors/PropertyTypeDeclarationCollector.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ private function isPropertyDocTyped(Property $property): bool
7070
$docCommentText = $docComment->getText();
7171

7272
// skip as unable to type
73-
return str_contains($docCommentText, 'callable') || str_contains($docCommentText, 'resource');
73+
return strpos($docCommentText, 'callable') !== false || strpos($docCommentText, 'resource') !== false;
7474
}
7575

7676
private function isGuardedByParentClassProperty(Scope $scope, Property $property): bool

src/Configuration.php

+26-8
Original file line numberDiff line numberDiff line change
@@ -4,32 +4,50 @@
44

55
namespace TomasVotruba\TypeCoverage;
66

7-
final readonly class Configuration
7+
final class Configuration
88
{
9+
/**
10+
* @var array<string, mixed>
11+
* @readonly
12+
*/
13+
private $parameters;
14+
915
/**
1016
* @param array<string, mixed> $parameters
1117
*/
12-
public function __construct(
13-
private array $parameters
14-
) {
18+
public function __construct(array $parameters)
19+
{
20+
$this->parameters = $parameters;
1521
}
1622

17-
public function getRequiredPropertyTypeLevel(): float|int
23+
/**
24+
* @return float|int
25+
*/
26+
public function getRequiredPropertyTypeLevel()
1827
{
1928
return $this->parameters['property'] ?? $this->parameters['property_type'];
2029
}
2130

22-
public function getRequiredParamTypeLevel(): float|int
31+
/**
32+
* @return float|int
33+
*/
34+
public function getRequiredParamTypeLevel()
2335
{
2436
return $this->parameters['param'] ?? $this->parameters['param_type'];
2537
}
2638

27-
public function getRequiredReturnTypeLevel(): float|int
39+
/**
40+
* @return float|int
41+
*/
42+
public function getRequiredReturnTypeLevel()
2843
{
2944
return $this->parameters['return'] ?? $this->parameters['return_type'];
3045
}
3146

32-
public function getRequiredDeclareLevel(): float|int
47+
/**
48+
* @return float|int
49+
*/
50+
public function getRequiredDeclareLevel()
3351
{
3452
return $this->parameters['declare'];
3553
}

src/Formatter/TypeCoverageFormatter.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@ final class TypeCoverageFormatter
1212
{
1313
/**
1414
* @return RuleError[]
15+
* @param float|int $minimalLevel
1516
*/
1617
public function formatErrors(
1718
string $message,
18-
float|int $minimalLevel,
19+
$minimalLevel,
1920
TypeCountAndMissingTypes $typeCountAndMissingTypes
2021
): array {
2122
if ($typeCountAndMissingTypes->getTotalCount() === 0) {

0 commit comments

Comments
 (0)