diff --git a/composer.json b/composer.json
index 8afb2b5..f5f2cf8 100644
--- a/composer.json
+++ b/composer.json
@@ -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":{
@@ -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": {
diff --git a/psalm.xml b/psalm.xml
new file mode 100644
index 0000000..b8a42df
--- /dev/null
+++ b/psalm.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
diff --git a/src/Annotation/TwigDebug.php b/src/Annotation/TwigDebug.php
index 933609b..652572e 100644
--- a/src/Annotation/TwigDebug.php
+++ b/src/Annotation/TwigDebug.php
@@ -2,10 +2,6 @@
declare(strict_types=1);
-/**
- * This file is part of the Madapaja.TwigModule package.
- */
-
namespace Madapaja\TwigModule\Annotation;
use Attribute;
diff --git a/src/Annotation/TwigErrorPath.php b/src/Annotation/TwigErrorPath.php
index b06654f..c235588 100644
--- a/src/Annotation/TwigErrorPath.php
+++ b/src/Annotation/TwigErrorPath.php
@@ -2,10 +2,6 @@
declare(strict_types=1);
-/**
- * This file is part of the Madapaja.TwigModule package.
- */
-
namespace Madapaja\TwigModule\Annotation;
use Attribute;
diff --git a/src/Annotation/TwigLoader.php b/src/Annotation/TwigLoader.php
index a2870bc..017640e 100644
--- a/src/Annotation/TwigLoader.php
+++ b/src/Annotation/TwigLoader.php
@@ -2,10 +2,6 @@
declare(strict_types=1);
-/**
- * This file is part of the Madapaja.TwigModule package.
- */
-
namespace Madapaja\TwigModule\Annotation;
use Attribute;
diff --git a/src/Annotation/TwigOptions.php b/src/Annotation/TwigOptions.php
index 08712e6..96e2157 100644
--- a/src/Annotation/TwigOptions.php
+++ b/src/Annotation/TwigOptions.php
@@ -2,10 +2,6 @@
declare(strict_types=1);
-/**
- * This file is part of the Madapaja.TwigModule package.
- */
-
namespace Madapaja\TwigModule\Annotation;
use Attribute;
diff --git a/src/Annotation/TwigPaths.php b/src/Annotation/TwigPaths.php
index 302145e..e894257 100644
--- a/src/Annotation/TwigPaths.php
+++ b/src/Annotation/TwigPaths.php
@@ -2,10 +2,6 @@
declare(strict_types=1);
-/**
- * This file is part of the Madapaja.TwigModule package.
- */
-
namespace Madapaja\TwigModule\Annotation;
use Attribute;
diff --git a/src/Annotation/TwigRedirectPath.php b/src/Annotation/TwigRedirectPath.php
index 7cfea4c..0d746c5 100644
--- a/src/Annotation/TwigRedirectPath.php
+++ b/src/Annotation/TwigRedirectPath.php
@@ -2,10 +2,6 @@
declare(strict_types=1);
-/**
- * This file is part of the Madapaja.TwigModule package.
- */
-
namespace Madapaja\TwigModule\Annotation;
use Attribute;
diff --git a/src/AppPathProvider.php b/src/AppPathProvider.php
index 1266a06..91e2bd1 100644
--- a/src/AppPathProvider.php
+++ b/src/AppPathProvider.php
@@ -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> */
class AppPathProvider implements ProviderInterface
{
public function __construct(
diff --git a/src/ErrorPagerRenderer.php b/src/ErrorPagerRenderer.php
index 0873a8c..facb77d 100644
--- a/src/ErrorPagerRenderer.php
+++ b/src/ErrorPagerRenderer.php
@@ -2,10 +2,6 @@
declare(strict_types=1);
-/**
- * This file is part of the Madapaja.TwigModule package.
- */
-
namespace Madapaja\TwigModule;
use BEAR\Resource\RenderInterface;
diff --git a/src/Exception/RuntimeException.php b/src/Exception/RuntimeException.php
index 7c7a04d..4e04d5e 100644
--- a/src/Exception/RuntimeException.php
+++ b/src/Exception/RuntimeException.php
@@ -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
diff --git a/src/Exception/TemplateNotFound.php b/src/Exception/TemplateNotFound.php
index fee72ee..1858252 100644
--- a/src/Exception/TemplateNotFound.php
+++ b/src/Exception/TemplateNotFound.php
@@ -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
diff --git a/src/MobileTemplateFinder.php b/src/MobileTemplateFinder.php
index 4a37cb7..14acc92 100644
--- a/src/MobileTemplateFinder.php
+++ b/src/MobileTemplateFinder.php
@@ -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;
diff --git a/src/MobileTwigModule.php b/src/MobileTwigModule.php
index 0764fe0..95491f1 100644
--- a/src/MobileTwigModule.php
+++ b/src/MobileTwigModule.php
@@ -2,10 +2,6 @@
declare(strict_types=1);
-/**
- * This file is part of the Madapaja.TwigModule package.
- */
-
namespace Madapaja\TwigModule;
use Ray\Di\AbstractModule;
diff --git a/src/OptionProvider.php b/src/OptionProvider.php
index 2c3192d..e55da26 100644
--- a/src/OptionProvider.php
+++ b/src/OptionProvider.php
@@ -2,10 +2,6 @@
declare(strict_types=1);
-/**
- * This file is part of the Madapaja.TwigModule package.
- */
-
namespace Madapaja\TwigModule;
use BEAR\AppMeta\AbstractAppMeta;
@@ -16,6 +12,7 @@
use function file_exists;
use function mkdir;
+/** @implements ProviderInterface */
class OptionProvider implements ProviderInterface
{
/** @SuppressWarnings(PHPMD.BooleanArgumentFlag) */
diff --git a/src/TemplateFinder.php b/src/TemplateFinder.php
index 02dab86..3763899 100644
--- a/src/TemplateFinder.php
+++ b/src/TemplateFinder.php
@@ -2,10 +2,6 @@
declare(strict_types=1);
-/**
- * This file is part of the Madapaja.TwigModule package.
- */
-
namespace Madapaja\TwigModule;
use function str_replace;
diff --git a/src/TemplateFinderInterface.php b/src/TemplateFinderInterface.php
index 457d449..a1ef712 100644
--- a/src/TemplateFinderInterface.php
+++ b/src/TemplateFinderInterface.php
@@ -2,10 +2,6 @@
declare(strict_types=1);
-/**
- * This file is part of the Madapaja.TwigModule package.
- */
-
namespace Madapaja\TwigModule;
interface TemplateFinderInterface
diff --git a/src/TwigErrorHandler.php b/src/TwigErrorHandler.php
index fd618f6..4d09c3f 100644
--- a/src/TwigErrorHandler.php
+++ b/src/TwigErrorHandler.php
@@ -2,10 +2,6 @@
declare(strict_types=1);
-/**
- * This file is part of the Madapaja.TwigModule package.
- */
-
namespace Madapaja\TwigModule;
use BEAR\Resource\Code;
diff --git a/src/TwigErrorPage.php b/src/TwigErrorPage.php
index b6216ea..4637762 100644
--- a/src/TwigErrorPage.php
+++ b/src/TwigErrorPage.php
@@ -2,10 +2,6 @@
declare(strict_types=1);
-/**
- * This file is part of the Madapaja.TwigModule package.
- */
-
namespace Madapaja\TwigModule;
use BEAR\Resource\RenderInterface;
diff --git a/src/TwigErrorPageHandler.php b/src/TwigErrorPageHandler.php
index 8c847a5..f3cf3f6 100644
--- a/src/TwigErrorPageHandler.php
+++ b/src/TwigErrorPageHandler.php
@@ -2,10 +2,6 @@
declare(strict_types=1);
-/**
- * This file is part of the Madapaja.TwigModule package.
- */
-
namespace Madapaja\TwigModule;
use BEAR\Resource\Code;
diff --git a/src/TwigErrorPageModule.php b/src/TwigErrorPageModule.php
index 456217e..36919a7 100644
--- a/src/TwigErrorPageModule.php
+++ b/src/TwigErrorPageModule.php
@@ -2,10 +2,6 @@
declare(strict_types=1);
-/**
- * This file is part of the Madapaja.TwigModule package.
- */
-
namespace Madapaja\TwigModule;
use BEAR\Resource\RenderInterface;
diff --git a/src/TwigModule.php b/src/TwigModule.php
index 4587250..c4e5721 100644
--- a/src/TwigModule.php
+++ b/src/TwigModule.php
@@ -2,10 +2,6 @@
declare(strict_types=1);
-/**
- * This file is part of the Madapaja.TwigModule package.
- */
-
namespace Madapaja\TwigModule;
use BEAR\Resource\RenderInterface;
diff --git a/src/TwigRenderer.php b/src/TwigRenderer.php
index b3ac1cd..2317180 100644
--- a/src/TwigRenderer.php
+++ b/src/TwigRenderer.php
@@ -2,10 +2,6 @@
declare(strict_types=1);
-/**
- * This file is part of the Madapaja.TwigModule package.
- */
-
namespace Madapaja\TwigModule;
use BEAR\Resource\Code;
diff --git a/tests/AppMetaTest.php b/tests/AppMetaTest.php
index b686f66..a57fa5d 100644
--- a/tests/AppMetaTest.php
+++ b/tests/AppMetaTest.php
@@ -2,10 +2,6 @@
declare(strict_types=1);
-/**
- * This file is part of the Madapaja.TwigModule package.
- */
-
namespace Madapaja\TwigModule;
use BEAR\Resource\RenderInterface;
diff --git a/tests/AppPathProviderTest.php b/tests/AppPathProviderTest.php
index 6f49bb7..a52f79d 100644
--- a/tests/AppPathProviderTest.php
+++ b/tests/AppPathProviderTest.php
@@ -2,10 +2,6 @@
declare(strict_types=1);
-/**
- * This file is part of the Madapaja.TwigModule package.
- */
-
namespace Madapaja\TwigModule;
use PHPUnit\Framework\TestCase;
diff --git a/tests/AppPathProviderTestModule.php b/tests/AppPathProviderTestModule.php
index 79e8cf6..873312d 100644
--- a/tests/AppPathProviderTestModule.php
+++ b/tests/AppPathProviderTestModule.php
@@ -2,10 +2,6 @@
declare(strict_types=1);
-/**
- * This file is part of the Madapaja.TwigModule package.
- */
-
namespace Madapaja\TwigModule;
use BEAR\AppMeta\AbstractAppMeta;
diff --git a/tests/ArrayLoaderTest.php b/tests/ArrayLoaderTest.php
index f9a85d6..5a59a90 100644
--- a/tests/ArrayLoaderTest.php
+++ b/tests/ArrayLoaderTest.php
@@ -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;
diff --git a/tests/ExtensionTest.php b/tests/ExtensionTest.php
index c7188c0..5aa2a40 100644
--- a/tests/ExtensionTest.php
+++ b/tests/ExtensionTest.php
@@ -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;
diff --git a/tests/FileLoaderTest.php b/tests/FileLoaderTest.php
index 981d7e5..1cbc1ec 100644
--- a/tests/FileLoaderTest.php
+++ b/tests/FileLoaderTest.php
@@ -2,10 +2,6 @@
declare(strict_types=1);
-/**
- * This file is part of the Madapaja.TwigModule package.
- */
-
namespace Madapaja\TwigModule;
use BEAR\Resource\Code;
diff --git a/tests/MobileTemplateFinderTest.php b/tests/MobileTemplateFinderTest.php
index ff4a641..cb464a0 100644
--- a/tests/MobileTemplateFinderTest.php
+++ b/tests/MobileTemplateFinderTest.php
@@ -2,10 +2,6 @@
declare(strict_types=1);
-/**
- * This file is part of the Madapaja.TwigModule package.
- */
-
namespace Madapaja\TwigModule;
use PHPUnit\Framework\TestCase;
diff --git a/tests/OptionProviderTest.php b/tests/OptionProviderTest.php
index b15f21f..9abc26e 100644
--- a/tests/OptionProviderTest.php
+++ b/tests/OptionProviderTest.php
@@ -2,10 +2,6 @@
declare(strict_types=1);
-/**
- * This file is part of the Madapaja.TwigModule package.
- */
-
namespace Madapaja\TwigModule;
use PHPUnit\Framework\TestCase;
diff --git a/tests/TwigErrorPageHandlerTest.php b/tests/TwigErrorPageHandlerTest.php
index 1f431b7..ff669b2 100644
--- a/tests/TwigErrorPageHandlerTest.php
+++ b/tests/TwigErrorPageHandlerTest.php
@@ -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;
diff --git a/tests/WeavedResourceTest.php b/tests/WeavedResourceTest.php
index 9ec1194..bf7298e 100644
--- a/tests/WeavedResourceTest.php
+++ b/tests/WeavedResourceTest.php
@@ -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;
diff --git a/tests/bootstrap.php b/tests/bootstrap.php
index 200a0e2..3002bb2 100644
--- a/tests/bootstrap.php
+++ b/tests/bootstrap.php
@@ -2,12 +2,7 @@
declare(strict_types=1);
-/**
- * This file is part of the Madapaja.TwigModule package.
- */
-
use Composer\Autoload\ClassLoader;
-use Doctrine\Common\Annotations\AnnotationRegistry;
use Koriym\Attributes\AttributeReader;
use Ray\ServiceLocator\ServiceLocator;