Skip to content

Commit

Permalink
release PHP 7.2 downgraded
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Oct 1, 2024
1 parent 7c6d267 commit 01498b5
Show file tree
Hide file tree
Showing 55 changed files with 168 additions and 947 deletions.
3 changes: 0 additions & 3 deletions .github/FUNDING.yml

This file was deleted.

45 changes: 0 additions & 45 deletions .github/workflows/code_analysis.yaml

This file was deleted.

49 changes: 0 additions & 49 deletions .github/workflows/downgraded_release.yaml

This file was deleted.

35 changes: 0 additions & 35 deletions .github/workflows/rector.yaml

This file was deleted.

28 changes: 0 additions & 28 deletions .github/workflows/various_php_install.yaml

This file was deleted.

24 changes: 0 additions & 24 deletions build/composer-php-72.json

This file was deleted.

10 changes: 0 additions & 10 deletions build/rector-downgrade-php-72.php

This file was deleted.

30 changes: 3 additions & 27 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,39 +5,15 @@
"license": "MIT",
"keywords": ["static analysis", "phpstan-extension"],
"require": {
"php": "^8.2",
"phpstan/phpstan": "^1.10.67"
},
"require-dev": {
"phpstan/extension-installer": "^1.3",
"phpunit/phpunit": "^10.5",
"symplify/easy-coding-standard": "^12.1",
"rector/rector": "^1.0.4",
"tracy/tracy": "^2.10",
"tomasvotruba/unused-public": "^0.2"
"php": "^7.2 || ^8.0",
"phpstan/phpstan": "^1.9.3",
"nette/utils": "^3.2 || ^4.0"
},
"autoload": {
"psr-4": {
"TomasVotruba\\TypeCoverage\\": "src"
}
},
"autoload-dev": {
"psr-4": {
"TomasVotruba\\TypeCoverage\\Tests\\": "tests"
}
},
"scripts": {
"check-cs": "vendor/bin/ecs check --ansi",
"fix-cs": "vendor/bin/ecs check --fix --ansi",
"phpstan": "vendor/bin/phpstan --ansi",
"rector": "vendor/bin/rector --dry-run --ansi",
"release": "vendor/bin/monorepo-builder release patch --ansi"
},
"config": {
"allow-plugins": {
"phpstan/extension-installer": true
}
},
"extra": {
"phpstan": {
"includes": [
Expand Down
14 changes: 0 additions & 14 deletions ecs.php

This file was deleted.

29 changes: 0 additions & 29 deletions phpstan.neon

This file was deleted.

12 changes: 0 additions & 12 deletions phpunit.xml

This file was deleted.

2 changes: 1 addition & 1 deletion src/Collectors/ParamTypeDeclarationCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,6 @@ private function hasFunctionLikeCallableParam(FunctionLike $functionLike): bool
}

$docCommentText = $docComment->getText();
return str_contains($docCommentText, '@param callable');
return strpos($docCommentText, '@param callable') !== false;
}
}
2 changes: 1 addition & 1 deletion src/Collectors/PropertyTypeDeclarationCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ private function isPropertyDocTyped(Property $property): bool
$docCommentText = $docComment->getText();

// skip as unable to type
return str_contains($docCommentText, 'callable') || str_contains($docCommentText, 'resource');
return strpos($docCommentText, 'callable') !== false || strpos($docCommentText, 'resource') !== false;
}

private function isGuardedByParentClassProperty(Scope $scope, Property $property): bool
Expand Down
39 changes: 30 additions & 9 deletions src/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,26 @@

namespace TomasVotruba\TypeCoverage;

final readonly class Configuration
final class Configuration
{
/**
* @var array<string, mixed>
* @readonly
*/
private $parameters;

/**
* @param array<string, mixed> $parameters
*/
public function __construct(
private array $parameters
) {
public function __construct(array $parameters)
{
$this->parameters = $parameters;
}

public function getRequiredPropertyTypeLevel(): float|int
/**
* @return float|int
*/
public function getRequiredPropertyTypeLevel()
{
return $this->parameters['property'] ?? $this->parameters['property_type'];
}
Expand All @@ -28,22 +37,34 @@ public function isConstantTypeCoverageEnabled(): bool
return $this->getRequiredConstantTypeLevel() > 0;
}

public function getRequiredConstantTypeLevel(): float|int
/**
* @return float|int
*/
public function getRequiredConstantTypeLevel()
{
return $this->parameters['constant'] ?? $this->parameters['constant_type'];
}

public function getRequiredParamTypeLevel(): float|int
/**
* @return float|int
*/
public function getRequiredParamTypeLevel()
{
return $this->parameters['param'] ?? $this->parameters['param_type'];
}

public function getRequiredReturnTypeLevel(): float|int
/**
* @return float|int
*/
public function getRequiredReturnTypeLevel()
{
return $this->parameters['return'] ?? $this->parameters['return_type'];
}

public function getRequiredDeclareLevel(): float|int
/**
* @return float|int
*/
public function getRequiredDeclareLevel()
{
return $this->parameters['declare'];
}
Expand Down
Loading

0 comments on commit 01498b5

Please sign in to comment.