Skip to content

Commit

Permalink
[deprecation] Remove deprecated PublicConstantVisibilityRector, clean…
Browse files Browse the repository at this point in the history
…up deprecated SetListInterface (rectorphp#6424)

* [deprecation] Remove deprecated PublicConstantVisibilityRector

* remove deprecated SystemError->getFile()

* cleanup

* cleanup deprecated SetListInterface

* bump dev deps

* [ci] skip deprecated set list interface
  • Loading branch information
TomasVotruba authored Nov 12, 2024
1 parent 5baf487 commit c23ba82
Show file tree
Hide file tree
Showing 16 changed files with 20 additions and 194 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/code_analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
-
name: 'Active Classes'
run: |
vendor/bin/class-leak check bin config src rules utils --skip-suffix "Rector" --skip-type="Rector\\Utils\\Compiler\\Unprefixer" --skip-type="Rector\\PhpDocParser\\PhpParser\\SmartPhpParserFactory" --skip-type="Rector\\NodeCollector\\BinaryOpConditionsCollector"
vendor/bin/class-leak check bin config src rules utils --skip-suffix "Rector" --skip-type="Rector\\Utils\\Compiler\\Unprefixer" --skip-type="Rector\\PhpDocParser\\PhpParser\\SmartPhpParserFactory" --skip-type="Rector\\NodeCollector\\BinaryOpConditionsCollector" --skip-type="Rector\\Set\\Contract\\SetListInterface"
-
name: 'Compatible PHPStan versions'
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,15 @@
"phpunit/phpunit": "^10.5",
"rector/release-notes-generator": "^0.3.0",
"rector/swiss-knife": "^0.2.16",
"rector/type-perfect": "^0.1.6",
"rector/type-perfect": "^1.0",
"shipmonk/composer-dependency-analyser": "^1.7",
"symplify/easy-coding-standard": "^12.3",
"symplify/phpstan-extensions": "^11.4",
"symplify/phpstan-rules": "^13.0",
"symplify/rule-doc-generator": "^12.2.5",
"symplify/vendor-patches": "^11.3",
"tomasvotruba/class-leak": "^0.2.15",
"tomasvotruba/unused-public": "^0.3.10",
"tomasvotruba/class-leak": "^1.1.2",
"tomasvotruba/unused-public": "^1.0",
"tracy/tracy": "^2.9"
},
"replace": {
Expand Down
18 changes: 3 additions & 15 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -289,21 +289,9 @@ parameters:
message: '#Parameters should have "PhpParser\\Node\\Expr\\Closure" types as the only types passed to this method#'
-
message: '#Parameters should have "PhpParser\\Node\\Stmt\\ClassMethod" types as the only types passed to this method#'
path: src/VendorLocker/ParentClassMethodTypeOverrideGuard.php

# deprecated
- '#Register "Rector\\Php71\\Rector\\ClassConst\\PublicConstantVisibilityRector" service to "php71\.php" config set#'
- '#Public method "Rector\\ValueObject\\Error\\SystemError\:\:getFile\(\)" is never used#'

# soon to be used
- '#Property Rector\\Configuration\\RectorConfigBuilder\:\:\$isWithPhpSetsUsed is never read, only written#'

# used once
- '#Interface "Rector\\Configuration\\Deprecation\\Contract\\DeprecatedInterface" has only single implementer\. Consider using the class directly as there is no point in using the interface#'

# rector internal deprecation
- '#Class Rector\\Set\\ValueObject\\(Level)?SetList implements deprecated interface#'
- '#Fetching class constant class of deprecated class Rector#'
paths:
- src/VendorLocker/ParentClassMethodTypeOverrideGuard.php
- rules/Privatization/NodeManipulator/VisibilityManipulator.php

# more advanced usage, but not always working
# see https://github.com/rectorphp/rector-src/actions/runs/11798721617/job/32865546672?pr=6422#step:5:110
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

72 changes: 0 additions & 72 deletions rules/Php71/Rector/ClassConst/PublicConstantVisibilityRector.php

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,8 @@ private function isValidUnionType(Type $type): bool
private function shouldSkipType(Type $type): bool
{
return ! $type instanceof MixedType &&
! $type->isNull()->yes() &&
! $type->isNull()
->yes() &&
! $this->isValidUnionType($type);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@ private function isClosureAndCallableType(Type $parameterStaticType, Type $argum
return true;
}

return $argumentStaticType->isCallable()->yes() && $this->isClosureObjectType($parameterStaticType);
return $argumentStaticType->isCallable()
->yes() && $this->isClosureObjectType($parameterStaticType);
}

private function isClosureObjectType(Type $type): bool
Expand Down
3 changes: 2 additions & 1 deletion src/NodeAnalyzer/PropertyAnalyzer.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ private function isCallableType(Type $type): bool
return false;
}

return $type->isCallable()->yes();
return $type->isCallable()
->yes();
}
}
3 changes: 2 additions & 1 deletion src/NodeTypeResolver/NodeTypeResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,8 @@ private function isAnonymousObjectType(Type $type): bool

private function isUnionTypeable(Type $first, Type $second): bool
{
return ! $first instanceof UnionType && ! $second instanceof UnionType && ! $second->isNull()->yes();
return ! $first instanceof UnionType && ! $second instanceof UnionType && ! $second->isNull()
->yes();
}

private function isMatchingUnionType(Type $resolvedType, ObjectType $requiredObjectType): bool
Expand Down
4 changes: 3 additions & 1 deletion src/PHPStanStaticTypeMapper/TypeMapper/ArrayTypeMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,9 @@ private function isIntegerKeyAndNonNestedArray(ArrayType $arrayType): bool
return false;
}

return ! $arrayType->getItemType()->isArray()->yes();
return ! $arrayType->getItemType()
->isArray()
->yes();
}

private function isClassStringArrayType(ArrayType $arrayType): bool
Expand Down
4 changes: 1 addition & 3 deletions src/Set/ValueObject/LevelSetList.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@

namespace Rector\Set\ValueObject;

use Rector\Set\Contract\SetListInterface;

/**
* @api
*/
final class LevelSetList implements SetListInterface
final class LevelSetList
{
/**
* @var string
Expand Down
4 changes: 1 addition & 3 deletions src/Set/ValueObject/SetList.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@

namespace Rector\Set\ValueObject;

use Rector\Set\Contract\SetListInterface;

/**
* @api
*/
final class SetList implements SetListInterface
final class SetList
{
/**
* @internal
Expand Down
5 changes: 0 additions & 5 deletions src/ValueObject/Error/SystemError.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,6 @@ public function getMessage(): string
return $this->message;
}

public function getFile(): string|null
{
return $this->relativeFilePath;
}

public function getLine(): int|null
{
return $this->line;
Expand Down

0 comments on commit c23ba82

Please sign in to comment.