diff --git a/packages/Caching/Cache.php b/packages/Caching/Cache.php index e7f12c75f51..5733a49b1a0 100644 --- a/packages/Caching/Cache.php +++ b/packages/Caching/Cache.php @@ -4,7 +4,7 @@ declare(strict_types=1); namespace Rector\Caching; -use Rector\Caching\ValueObject\Storage\CacheStorageInterface; +use Rector\Caching\Contract\ValueObject\Storage\CacheStorageInterface; final class Cache { diff --git a/packages/Caching/ValueObject/Storage/CacheStorageInterface.php b/packages/Caching/Contract/ValueObject/Storage/CacheStorageInterface.php similarity index 88% rename from packages/Caching/ValueObject/Storage/CacheStorageInterface.php rename to packages/Caching/Contract/ValueObject/Storage/CacheStorageInterface.php index ff38585936d..07983aec3a1 100644 --- a/packages/Caching/ValueObject/Storage/CacheStorageInterface.php +++ b/packages/Caching/Contract/ValueObject/Storage/CacheStorageInterface.php @@ -2,10 +2,11 @@ declare(strict_types=1); -namespace Rector\Caching\ValueObject\Storage; +namespace Rector\Caching\Contract\ValueObject\Storage; /** * inspired by https://github.com/phpstan/phpstan-src/blob/560652088406d7461c2c4ad4897784e33f8ab312/src/Cache/CacheStorage.php + * @internal */ interface CacheStorageInterface { diff --git a/packages/Caching/ValueObject/Storage/FileCacheStorage.php b/packages/Caching/ValueObject/Storage/FileCacheStorage.php index 9dbe4e9365a..7eee2eec171 100644 --- a/packages/Caching/ValueObject/Storage/FileCacheStorage.php +++ b/packages/Caching/ValueObject/Storage/FileCacheStorage.php @@ -6,6 +6,7 @@ namespace Rector\Caching\ValueObject\Storage; use Nette\Utils\Random; use PHPStan\File\FileWriter; +use Rector\Caching\Contract\ValueObject\Storage\CacheStorageInterface; use Rector\Caching\ValueObject\CacheFilePaths; use Rector\Caching\ValueObject\CacheItem; use Symplify\EasyCodingStandard\Caching\Exception\CachingException; diff --git a/packages/Caching/ValueObject/Storage/MemoryCacheStorage.php b/packages/Caching/ValueObject/Storage/MemoryCacheStorage.php index a6f3170c5d0..815603132e3 100644 --- a/packages/Caching/ValueObject/Storage/MemoryCacheStorage.php +++ b/packages/Caching/ValueObject/Storage/MemoryCacheStorage.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace Rector\Caching\ValueObject\Storage; +use Rector\Caching\Contract\ValueObject\Storage\CacheStorageInterface; use Rector\Caching\ValueObject\CacheItem; /** diff --git a/phpstan.neon b/phpstan.neon index 97adbf6a74a..ead1d700795 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -181,9 +181,6 @@ parameters: paths: - rules/Php80/Rector/If_/NullsafeOperatorRector.php - # covered in symplify main - - '#Method "(equal|match)(.*?)\(\)" returns bool type, so the name should start with is/has/was#' - - message: '#Comparison operation "<" between 0 and 2 is always true#' paths: @@ -387,13 +384,6 @@ parameters: - '#Method Rector\\Core\\Tests\\DependencyInjection\\ConfigurableRectorImportConfigCallsMergeTest\:\:provideData\(\) return type has no value type specified in iterable type Iterator#' - # fixed in dev-main - - - message: '#Use dependency injection instead of dependency juggling#' - paths: - # better reflection static design - - packages/NodeTypeResolver/Reflection/BetterReflection/SourceLocatorProvider/DynamicSourceLocatorProvider.php - - message: '#Use value object over return of values#' paths: @@ -506,11 +496,12 @@ parameters: - '#Method "decorateReturnWithSpecificType\(\)" returns bool type, so the name should start with is/has/was#' - '#Method "resolveObjectType\(\)" returns bool type, so the name should start with is/has/was#' - # internal contract, not meant for re-use at rector consumer level + - '#Method "(equal|match)(.*?)\(\)" returns bool type, so the name should start with is/has/was#' + - - message: '#Interface must be located in "Contract" namespace#' + message: '#Use dependency injection instead of dependency juggling#' paths: - - packages/Caching/ValueObject/Storage/CacheStorageInterface.php + - packages/NodeTypeResolver/Reflection/BetterReflection/SourceLocatorProvider # resolve later - diff --git a/src/Configuration/Option.php b/src/Configuration/Option.php index dcf2e2f7df3..e57dccd3b13 100644 --- a/src/Configuration/Option.php +++ b/src/Configuration/Option.php @@ -5,7 +5,7 @@ declare(strict_types=1); namespace Rector\Core\Configuration; use JetBrains\PhpStorm\Immutable; -use Rector\Caching\ValueObject\Storage\CacheStorageInterface; +use Rector\Caching\Contract\ValueObject\Storage\CacheStorageInterface; use Rector\Caching\ValueObject\Storage\FileCacheStorage; use Symplify\Skipper\ValueObject\Option as SkipperOption;