Skip to content

Commit

Permalink
Merge pull request #44 from koriym/psalm
Browse files Browse the repository at this point in the history
Soothe psalm
  • Loading branch information
koriym authored Jan 10, 2023
2 parents 85fc33d + d936820 commit 01334b9
Show file tree
Hide file tree
Showing 34 changed files with 20 additions and 131 deletions.
6 changes: 4 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
"phpmd/phpmd": "^2.6",
"rector/rector": "^0.15.3",
"ray/rector-ray": "^1.0",
"doctrine/coding-standard": "^11.1"
"doctrine/coding-standard": "^11.1",
"vimeo/psalm": "^5.4"
},
"autoload":{
"psr-4":{
Expand All @@ -50,7 +51,8 @@
"tests": ["@cs", "phpstan analyse -l max src tests -c phpstan.neon --no-progress", "@test"],
"coverage": ["php -dzend_extension=xdebug.so -dxdebug.mode=coverage ./vendor/bin/phpunit --coverage-text --coverage-html=build/coverage"],
"cs": ["php-cs-fixer fix -v --dry-run", "phpcs --standard=phpcs.xml src;"],
"cs-fix": ["phpcbf src tests"]
"cs-fix": ["phpcbf src tests"],
"sa": "psalm"
},
"config": {
"allow-plugins": {
Expand Down
14 changes: 14 additions & 0 deletions psalm.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0"?>
<psalm
errorLevel="4"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config"
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
>
<projectFiles>
<directory name="src" />
<ignoreFiles>
<directory name="vendor" />
</ignoreFiles>
</projectFiles>
</psalm>
4 changes: 0 additions & 4 deletions src/Annotation/TwigDebug.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

declare(strict_types=1);

/**
* This file is part of the Madapaja.TwigModule package.
*/

namespace Madapaja\TwigModule\Annotation;

use Attribute;
Expand Down
4 changes: 0 additions & 4 deletions src/Annotation/TwigErrorPath.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

declare(strict_types=1);

/**
* This file is part of the Madapaja.TwigModule package.
*/

namespace Madapaja\TwigModule\Annotation;

use Attribute;
Expand Down
4 changes: 0 additions & 4 deletions src/Annotation/TwigLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

declare(strict_types=1);

/**
* This file is part of the Madapaja.TwigModule package.
*/

namespace Madapaja\TwigModule\Annotation;

use Attribute;
Expand Down
4 changes: 0 additions & 4 deletions src/Annotation/TwigOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

declare(strict_types=1);

/**
* This file is part of the Madapaja.TwigModule package.
*/

namespace Madapaja\TwigModule\Annotation;

use Attribute;
Expand Down
4 changes: 0 additions & 4 deletions src/Annotation/TwigPaths.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

declare(strict_types=1);

/**
* This file is part of the Madapaja.TwigModule package.
*/

namespace Madapaja\TwigModule\Annotation;

use Attribute;
Expand Down
4 changes: 0 additions & 4 deletions src/Annotation/TwigRedirectPath.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

declare(strict_types=1);

/**
* This file is part of the Madapaja.TwigModule package.
*/

namespace Madapaja\TwigModule\Annotation;

use Attribute;
Expand Down
5 changes: 1 addition & 4 deletions src/AppPathProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,12 @@

declare(strict_types=1);

/**
* This file is part of the Madapaja.TwigModule package.
*/

namespace Madapaja\TwigModule;

use BEAR\AppMeta\AbstractAppMeta;
use Ray\Di\ProviderInterface;

/** @implements ProviderInterface<array<string>> */
class AppPathProvider implements ProviderInterface
{
public function __construct(
Expand Down
4 changes: 0 additions & 4 deletions src/ErrorPagerRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

declare(strict_types=1);

/**
* This file is part of the Madapaja.TwigModule package.
*/

namespace Madapaja\TwigModule;

use BEAR\Resource\RenderInterface;
Expand Down
4 changes: 0 additions & 4 deletions src/Exception/RuntimeException.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

declare(strict_types=1);

/**
* This file is part of the Madapaja.TwigModule package.
*/

namespace Madapaja\TwigModule\Exception;

class RuntimeException extends \RuntimeException
Expand Down
4 changes: 0 additions & 4 deletions src/Exception/TemplateNotFound.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

declare(strict_types=1);

/**
* This file is part of the Madapaja.TwigModule package.
*/

namespace Madapaja\TwigModule\Exception;

class TemplateNotFound extends RuntimeException
Expand Down
4 changes: 0 additions & 4 deletions src/MobileTemplateFinder.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

declare(strict_types=1);

/**
* This file is part of the Madapaja.TwigModule package.
*/

namespace Madapaja\TwigModule;

use Madapaja\TwigModule\Annotation\TwigPaths;
Expand Down
4 changes: 0 additions & 4 deletions src/MobileTwigModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

declare(strict_types=1);

/**
* This file is part of the Madapaja.TwigModule package.
*/

namespace Madapaja\TwigModule;

use Ray\Di\AbstractModule;
Expand Down
5 changes: 1 addition & 4 deletions src/OptionProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

declare(strict_types=1);

/**
* This file is part of the Madapaja.TwigModule package.
*/

namespace Madapaja\TwigModule;

use BEAR\AppMeta\AbstractAppMeta;
Expand All @@ -16,6 +12,7 @@
use function file_exists;
use function mkdir;

/** @implements ProviderInterface<array{"debug":bool, "cache":string}> */
class OptionProvider implements ProviderInterface
{
/** @SuppressWarnings(PHPMD.BooleanArgumentFlag) */
Expand Down
4 changes: 0 additions & 4 deletions src/TemplateFinder.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

declare(strict_types=1);

/**
* This file is part of the Madapaja.TwigModule package.
*/

namespace Madapaja\TwigModule;

use function str_replace;
Expand Down
4 changes: 0 additions & 4 deletions src/TemplateFinderInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

declare(strict_types=1);

/**
* This file is part of the Madapaja.TwigModule package.
*/

namespace Madapaja\TwigModule;

interface TemplateFinderInterface
Expand Down
4 changes: 0 additions & 4 deletions src/TwigErrorHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

declare(strict_types=1);

/**
* This file is part of the Madapaja.TwigModule package.
*/

namespace Madapaja\TwigModule;

use BEAR\Resource\Code;
Expand Down
4 changes: 0 additions & 4 deletions src/TwigErrorPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

declare(strict_types=1);

/**
* This file is part of the Madapaja.TwigModule package.
*/

namespace Madapaja\TwigModule;

use BEAR\Resource\RenderInterface;
Expand Down
4 changes: 0 additions & 4 deletions src/TwigErrorPageHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

declare(strict_types=1);

/**
* This file is part of the Madapaja.TwigModule package.
*/

namespace Madapaja\TwigModule;

use BEAR\Resource\Code;
Expand Down
4 changes: 0 additions & 4 deletions src/TwigErrorPageModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

declare(strict_types=1);

/**
* This file is part of the Madapaja.TwigModule package.
*/

namespace Madapaja\TwigModule;

use BEAR\Resource\RenderInterface;
Expand Down
4 changes: 0 additions & 4 deletions src/TwigModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

declare(strict_types=1);

/**
* This file is part of the Madapaja.TwigModule package.
*/

namespace Madapaja\TwigModule;

use BEAR\Resource\RenderInterface;
Expand Down
4 changes: 0 additions & 4 deletions src/TwigRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

declare(strict_types=1);

/**
* This file is part of the Madapaja.TwigModule package.
*/

namespace Madapaja\TwigModule;

use BEAR\Resource\Code;
Expand Down
4 changes: 0 additions & 4 deletions tests/AppMetaTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

declare(strict_types=1);

/**
* This file is part of the Madapaja.TwigModule package.
*/

namespace Madapaja\TwigModule;

use BEAR\Resource\RenderInterface;
Expand Down
4 changes: 0 additions & 4 deletions tests/AppPathProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

declare(strict_types=1);

/**
* This file is part of the Madapaja.TwigModule package.
*/

namespace Madapaja\TwigModule;

use PHPUnit\Framework\TestCase;
Expand Down
4 changes: 0 additions & 4 deletions tests/AppPathProviderTestModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

declare(strict_types=1);

/**
* This file is part of the Madapaja.TwigModule package.
*/

namespace Madapaja\TwigModule;

use BEAR\AppMeta\AbstractAppMeta;
Expand Down
4 changes: 0 additions & 4 deletions tests/ArrayLoaderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

declare(strict_types=1);

/**
* This file is part of the Madapaja.TwigModule package.
*/

namespace Madapaja\TwigModule;

use Madapaja\TwigModule\Exception\TemplateNotFound;
Expand Down
4 changes: 0 additions & 4 deletions tests/ExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

declare(strict_types=1);

/**
* This file is part of the Madapaja.TwigModule package.
*/

namespace Madapaja\TwigModule;

use Madapaja\TwigModule\Resource\Page\TwigFilter;
Expand Down
4 changes: 0 additions & 4 deletions tests/FileLoaderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

declare(strict_types=1);

/**
* This file is part of the Madapaja.TwigModule package.
*/

namespace Madapaja\TwigModule;

use BEAR\Resource\Code;
Expand Down
4 changes: 0 additions & 4 deletions tests/MobileTemplateFinderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

declare(strict_types=1);

/**
* This file is part of the Madapaja.TwigModule package.
*/

namespace Madapaja\TwigModule;

use PHPUnit\Framework\TestCase;
Expand Down
4 changes: 0 additions & 4 deletions tests/OptionProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

declare(strict_types=1);

/**
* This file is part of the Madapaja.TwigModule package.
*/

namespace Madapaja\TwigModule;

use PHPUnit\Framework\TestCase;
Expand Down
4 changes: 0 additions & 4 deletions tests/TwigErrorPageHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

declare(strict_types=1);

/**
* This file is part of the Madapaja.TwigModule package.
*/

namespace Madapaja\TwigModule;

use BEAR\Resource\Exception\ResourceNotFoundException as NotFound;
Expand Down
4 changes: 0 additions & 4 deletions tests/WeavedResourceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

declare(strict_types=1);

/**
* This file is part of the Madapaja.TwigModule package.
*/

namespace Madapaja\TwigModule;

use Madapaja\TwigModule\Resource\Page\Index;
Expand Down
Loading

0 comments on commit 01334b9

Please sign in to comment.