Skip to content

Commit

Permalink
Merge pull request #493 from greg0ire/remove-psalm
Browse files Browse the repository at this point in the history
Drop Psalm in favor of just PHPStan
  • Loading branch information
greg0ire authored Nov 4, 2024
2 parents 1c6103a + 23c35d7 commit 5abaa2f
Show file tree
Hide file tree
Showing 10 changed files with 29 additions and 90 deletions.
2 changes: 0 additions & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,3 @@
/phpcs.xml.dist export-ignore
/phpstan.neon.dist export-ignore
/phpstan-baseline.neon export-ignore
/psalm.xml export-ignore
/psalm-baseline.xml export-ignore
2 changes: 1 addition & 1 deletion .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ on:
jobs:
static-analysis:
name: "Static Analysis"
uses: "doctrine/.github/.github/workflows/static-analysis[email protected]"
uses: "doctrine/.github/.github/workflows/phpstan[email protected]"
3 changes: 1 addition & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@
"phpstan/phpstan": "^1.10",
"phpunit/phpunit": "^9.6.13 || ^10.4.2",
"symfony/cache": "^5.4 || ^6.3 || ^7",
"symfony/var-exporter": "^5.4 || ^6.3 || ^7",
"vimeo/psalm": "^5.9"
"symfony/var-exporter": "^5.4 || ^6.3 || ^7"
},
"suggest": {
"alcaeus/mongo-php-adapter": "For using MongoDB ODM 1.3 with PHP 7 (deprecated)",
Expand Down
30 changes: 0 additions & 30 deletions psalm-baseline.xml

This file was deleted.

28 changes: 0 additions & 28 deletions psalm.xml

This file was deleted.

6 changes: 3 additions & 3 deletions src/AbstractFixture.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,10 @@ public function addReference($name, $object)
* @see ReferenceRepository::getReference()
*
* @param string $name
* @psalm-param class-string<T>|null $class
* @phpstan-param class-string<T>|null $class
*
* @return object
* @psalm-return ($class is null ? object : T)
* @phpstan-return ($class is null ? object : T)
*
* @template T of object
*/
Expand All @@ -110,7 +110,7 @@ public function getReference($name, ?string $class = null)
* @see ReferenceRepository::hasReference()
*
* @param string $name
* @psalm-param class-string $class
* @phpstan-param class-string $class
*
* @return bool
*/
Expand Down
2 changes: 1 addition & 1 deletion src/DependentFixtureInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ interface DependentFixtureInterface
* This method must return an array of fixtures classes
* on which the implementing class depends on
*
* @psalm-return array<class-string<FixtureInterface>>
* @phpstan-return array<class-string<FixtureInterface>>
*/
public function getDependencies();
}
22 changes: 11 additions & 11 deletions src/Loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ class Loader
/**
* Array of fixture object instances to execute.
*
* @psalm-var array<class-string<FixtureInterface>, FixtureInterface>
* @phpstan-var array<class-string<FixtureInterface>, FixtureInterface>
*/
private array $fixtures = [];

/**
* Array of ordered fixture object instances.
*
* @psalm-var array<class-string<FixtureInterface>|int, FixtureInterface>
* @phpstan-var array<class-string<FixtureInterface>|int, FixtureInterface>
*/
private array $orderedFixtures = [];

Expand Down Expand Up @@ -175,7 +175,7 @@ public function addFixture(FixtureInterface $fixture)
/**
* Returns the array of data fixtures to execute.
*
* @psalm-return array<class-string<FixtureInterface>|int, FixtureInterface>
* @phpstan-return array<class-string<FixtureInterface>|int, FixtureInterface>
*/
public function getFixtures()
{
Expand All @@ -200,7 +200,7 @@ public function getFixtures()
* Check if a given fixture is transient and should not be considered a data fixtures
* class.
*
* @psalm-param class-string<object> $className
* @phpstan-param class-string<object> $className
*
* @return bool
*/
Expand Down Expand Up @@ -264,7 +264,7 @@ private function orderFixturesByNumber(): void
*/
private function orderFixturesByDependencies()
{
/** @psalm-var array<class-string<DependentFixtureInterface>, int> */
/** @phpstan-var array<class-string<DependentFixtureInterface>, int> */
$sequenceForClasses = [];

// If fixtures were already ordered by number then we need
Expand Down Expand Up @@ -365,7 +365,7 @@ private function orderFixturesByDependencies()
$this->orderedFixtures = array_merge($this->orderedFixtures, $orderedFixtures);
}

/** @psalm-param iterable<class-string> $dependenciesClasses */
/** @phpstan-param iterable<class-string> $dependenciesClasses */
private function validateDependencies(iterable $dependenciesClasses): bool
{
$loadedFixtureClasses = array_keys($this->fixtures);
Expand All @@ -383,10 +383,10 @@ private function validateDependencies(iterable $dependenciesClasses): bool
}

/**
* @psalm-param array<class-string<DependentFixtureInterface>, int> $sequences
* @psalm-param iterable<class-string<FixtureInterface>>|null $classes
* @phpstan-param array<class-string<DependentFixtureInterface>, int> $sequences
* @phpstan-param iterable<class-string<FixtureInterface>>|null $classes
*
* @psalm-return array<class-string<FixtureInterface>>
* @phpstan-return array<class-string<FixtureInterface>>
*/
private function getUnsequencedClasses(array $sequences, ?iterable $classes = null): array
{
Expand All @@ -410,10 +410,10 @@ private function getUnsequencedClasses(array $sequences, ?iterable $classes = nu
/**
* Load fixtures from files contained in iterator.
*
* @psalm-param Iterator<SplFileInfo> $iterator Iterator over files from
* @phpstan-param Iterator<SplFileInfo> $iterator Iterator over files from
* which fixtures should be loaded.
*
* @psalm-return list<FixtureInterface> $fixtures Array of loaded fixture object instances.
* @phpstan-return list<FixtureInterface> $fixtures Array of loaded fixture object instances.
*/
private function loadFromIterator(Iterator $iterator): array
{
Expand Down
22 changes: 11 additions & 11 deletions src/ReferenceRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ class ReferenceRepository
* List of named references to the fixture objects
* gathered during fixure loading
*
* @psalm-var array<string, object>
* @phpstan-var array<string, object>
*/
private array $references = [];

/**
* List of named references to the fixture objects
* gathered during fixure loading
*
* @psalm-var array<class-string, array<string, object>>
* @phpstan-var array<class-string, array<string, object>>
*/
private array $referencesByClass = [];

Expand All @@ -44,7 +44,7 @@ class ReferenceRepository
* in case a reference gets no longer managed, it will
* use a proxy referenced by this identity
*
* @psalm-var array<string, mixed>
* @phpstan-var array<string, mixed>
*/
private array $identities = [];

Expand All @@ -53,7 +53,7 @@ class ReferenceRepository
* in case a reference gets no longer managed, it will
* use a proxy referenced by this identity
*
* @psalm-var array<class-string, array<string, mixed>>
* @phpstan-var array<class-string, array<string, mixed>>
*/
private array $identitiesByClass = [];

Expand Down Expand Up @@ -200,10 +200,10 @@ public function addReference($name, $object)
* named by $name
*
* @param string $name
* @psalm-param class-string<T>|null $class
* @phpstan-param class-string<T>|null $class
*
* @return object
* @psalm-return ($class is null ? object : T)
* @phpstan-return ($class is null ? object : T)
*
* @throws OutOfBoundsException - if repository does not exist.
*
Expand Down Expand Up @@ -257,7 +257,7 @@ public function getReference($name, ?string $class = null)
* named by $name
*
* @param string $name
* @psalm-param class-string $class
* @phpstan-param class-string $class
*
* @return bool
*/
Expand Down Expand Up @@ -324,7 +324,7 @@ public function hasIdentity($name, ?string $class = null)
*
* Get all stored identities
*
* @psalm-return array<string, object>
* @phpstan-return array<string, object>
*/
public function getIdentities()
{
Expand All @@ -334,7 +334,7 @@ public function getIdentities()
/**
* Get all stored identities
*
* @psalm-return array<class-string, array<string, object>>
* @phpstan-return array<class-string, array<string, object>>
*/
public function getIdentitiesByClass(): array
{
Expand All @@ -346,7 +346,7 @@ public function getIdentitiesByClass(): array
*
* Get all stored references
*
* @psalm-return array<string, object>
* @phpstan-return array<string, object>
*/
public function getReferences()
{
Expand All @@ -356,7 +356,7 @@ public function getReferences()
/**
* Get all stored references
*
* @psalm-return array<class-string, array<string, object>>
* @phpstan-return array<class-string, array<string, object>>
*/
public function getReferencesByClass(): array
{
Expand Down
2 changes: 1 addition & 1 deletion src/Sorter/Vertex.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class Vertex
public const IN_PROGRESS = 1;
public const VISITED = 2;

/** @psalm-var self::* */
/** @phpstan-var self::* */
public int $state = self::NOT_VISITED;

/** Actual node value. */
Expand Down

0 comments on commit 5abaa2f

Please sign in to comment.