Skip to content

Commit

Permalink
replaced psalm-assert-if-true, psalm-assert-if-false, psalm-import-ty…
Browse files Browse the repository at this point in the history
…pe,psalm-type with correct phpstan-*

.github/workflows/*, README.md, .gitattributes // replaced psalm with phpstan
  • Loading branch information
Chrico committed Jan 24, 2025
1 parent 0995b5e commit 25d32c2
Show file tree
Hide file tree
Showing 14 changed files with 19 additions and 21 deletions.
3 changes: 1 addition & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
* text eol=lf

tests export-ignore
.psalm export-ignore
.github export-ignore
.gitattributes export-ignore
.gitignore export-ignore
README.md export-ignore
phpcs.xml.dist export-ignore
phpunit.xml.dist export-ignore
psalm.xml export-ignore
phpstan.neon.dist export-ignore
2 changes: 1 addition & 1 deletion .github/workflows/php-qa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- '**workflows/php-qa.yml'
- '**.php'
- '**phpcs.xml.dist'
- '**psalm.xml'
- '**phpstan.neon.dist'
- '**composer.json'
pull_request:
paths:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/php-unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:

- name: Setup dependencies for PSR-11 target version
run: |
composer remove inpsyde/php-coding-standards inpsyde/wp-stubs-versions vimeo/psalm --dev --no-update
composer remove inpsyde/php-coding-standards inpsyde/wp-stubs-versions --dev --no-update
composer require "psr/container:${{ matrix.container-versions }}" --no-update
composer config --no-plugins allow-plugins.roots/wordpress-core-installer false
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ When installed for development via Composer, the package also requires:

* inpsyde/php-coding-standards
* roots/wordpress
* vimeo/psalm
* phpstan/phpstan
* phpunit/phpunit
* brain/monkey
* mikey179/vfsstream
Expand Down
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ When installed for development, via Composer, the package also requires:

* inpsyde/php-coding-standards
* roots/wordpress
* vimeo/psalm
* phpstan/phpstan
* phpunit/phpunit
* brain/monkey
* mikey179/vfsstream
Expand Down
6 changes: 3 additions & 3 deletions src/Container/ContainerConfigurator.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
use Psr\Container\ContainerInterface;

/**
* @psalm-import-type Service from \Inpsyde\Modularity\Module\ServiceModule
* @psalm-import-type ExtendingService from \Inpsyde\Modularity\Module\ExtendingModule
* @phpstan-import-type Service from \Inpsyde\Modularity\Module\ServiceModule
* @phpstan-import-type ExtendingService from \Inpsyde\Modularity\Module\ExtendingModule
*/
class ContainerConfigurator
{
Expand Down Expand Up @@ -113,7 +113,7 @@ public function hasExtension(string $id): bool
/**
* @return ContainerInterface
*
* @psalm-assert ContainerInterface $this->compiledContainer
* @phpstan-assert ContainerInterface $this->compiledContainer
*/
public function createReadOnlyContainer(): ContainerInterface
{
Expand Down
6 changes: 3 additions & 3 deletions src/Container/PackageProxyContainer.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ public function has(string $id): bool
/**
* @return bool
*
* @psalm-assert-if-true ContainerInterface $this->container
* @psalm-assert-if-false null $this->container
* @phpstan-assert-if-true ContainerInterface $this->container
* @phpstan-assert-if-false null $this->container
*/
private function tryContainer(): bool
{
Expand All @@ -67,7 +67,7 @@ private function tryContainer(): bool
* @param string $id
* @return void
*
* @psalm-assert ContainerInterface $this->container
* @phpstan-assert ContainerInterface $this->container
*/
private function assertPackageBooted(string $id): void
{
Expand Down
4 changes: 2 additions & 2 deletions src/Container/ReadOnlyContainer.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
use Psr\Container\NotFoundExceptionInterface;

/**
* @psalm-import-type Service from \Inpsyde\Modularity\Module\ServiceModule
* @psalm-import-type ExtendingService from \Inpsyde\Modularity\Module\ExtendingModule
* @phpstan-import-type Service from \Inpsyde\Modularity\Module\ServiceModule
* @phpstan-import-type ExtendingService from \Inpsyde\Modularity\Module\ExtendingModule
*/
class ReadOnlyContainer implements ContainerInterface
{
Expand Down
2 changes: 1 addition & 1 deletion src/Container/ServiceExtensions.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use Psr\Container\ContainerInterface as Container;

/**
* @psalm-import-type ExtendingService from \Inpsyde\Modularity\Module\ExtendingModule
* @phpstan-import-type ExtendingService from \Inpsyde\Modularity\Module\ExtendingModule
*/
class ServiceExtensions
{
Expand Down
2 changes: 1 addition & 1 deletion src/Module/ExtendingModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use Psr\Container\ContainerInterface;

/**
* @psalm-type ExtendingService = callable(mixed $service, ContainerInterface $container):mixed
* @phpstan-type ExtendingService callable(mixed $service, ContainerInterface $container):mixed
*/
interface ExtendingModule extends Module
{
Expand Down
2 changes: 1 addition & 1 deletion src/Module/FactoryModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace Inpsyde\Modularity\Module;

/**
* @psalm-import-type Service from ServiceModule
* @phpstan-import-type Service from ServiceModule
*/
interface FactoryModule extends Module
{
Expand Down
2 changes: 1 addition & 1 deletion src/Module/ServiceModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use Psr\Container\ContainerInterface;

/**
* @psalm-type Service = callable(ContainerInterface $container):mixed
* @phpstan-type Service callable(ContainerInterface $container):mixed
*/
interface ServiceModule extends Module
{
Expand Down
4 changes: 2 additions & 2 deletions src/Package.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
use Psr\Container\ContainerInterface;

/**
* @psalm-import-type Service from \Inpsyde\Modularity\Module\ServiceModule
* @psalm-import-type ExtendingService from \Inpsyde\Modularity\Module\ExtendingModule
* @phpstan-import-type Service from \Inpsyde\Modularity\Module\ServiceModule
* @phpstan-import-type ExtendingService from \Inpsyde\Modularity\Module\ExtendingModule
*
* phpcs:disable WordPress.PHP.DevelopmentFunctions.error_log_trigger_error
*/
Expand Down
1 change: 0 additions & 1 deletion src/Properties/BaseProperties.php
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,6 @@ public function has(string $key): bool
public function isDebug(): bool
{
if ($this->isDebug === null) {
/** @psalm-suppress TypeDoesNotContainType */
$this->isDebug = defined('WP_DEBUG') && WP_DEBUG;
}

Expand Down

0 comments on commit 25d32c2

Please sign in to comment.