diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..4b765ca --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,11 @@ +- repo: git@github.com:litphp/pre-commit-php.git + sha: 0f011f8 + hooks: + - id: php-cbf + files: \.(php)$ + - id: php-cs + files: \.(php)$ + - id: php-unit + files: \.(php)$ + - id: php-stan + files: \.(php)$ diff --git a/RoadRunnerConfiguration.php b/RoadRunnerConfiguration.php index c2f8640..0160e41 100644 --- a/RoadRunnerConfiguration.php +++ b/RoadRunnerConfiguration.php @@ -4,7 +4,6 @@ namespace Lit\Runner\RoadRunner; -use Http\Factory\Diactoros\ResponseFactory; use Lit\Air\Configurator as C; use Lit\Bolt\BoltApp; use Psr\Http\Message\ResponseFactoryInterface; @@ -12,6 +11,7 @@ use Spiral\Goridge\StreamRelay; use Spiral\RoadRunner\PSR7Client; use Spiral\RoadRunner\Worker; +use Zend\Diactoros\ResponseFactory; class RoadRunnerConfiguration { diff --git a/RoadRunnerWorker.php b/RoadRunnerWorker.php index 0d576f0..623bb3f 100644 --- a/RoadRunnerWorker.php +++ b/RoadRunnerWorker.php @@ -43,7 +43,11 @@ public static function run($config = []) ? $config : BoltContainerConfiguration::createContainer($config + RoadRunnerConfiguration::default()); - Factory::of($container)->getOrProduce(static::class)->loop(); + /** + * @var static + */ + $instance = Factory::of($container)->getOrProduce(static::class); + $instance->loop(); exit(0); } diff --git a/composer.json b/composer.json index 685ab81..243d578 100644 --- a/composer.json +++ b/composer.json @@ -21,6 +21,12 @@ "litphp/bolt": "^0.9", "spiral/roadrunner": "^1.2" }, + "require-dev": { + "phpunit/phpunit": "^7.5", + "phpstan/phpstan-shim": "^0.11.7", + "squizlabs/php_codesniffer": "^3.4", + "phpstan/phpstan-phpunit": "^0.11.2" + }, "extra": { "branch-alias": { "dev-master": "0.9.x-dev" diff --git a/phpcs.xml.dist b/phpcs.xml.dist new file mode 100644 index 0000000..4032897 --- /dev/null +++ b/phpcs.xml.dist @@ -0,0 +1,11 @@ + + + ./ + ./**/_example/* + ./**/Test/* + ./vendor/* + + + + \ No newline at end of file diff --git a/phpstan.neon.dist b/phpstan.neon.dist new file mode 100644 index 0000000..4b2f9c1 --- /dev/null +++ b/phpstan.neon.dist @@ -0,0 +1,6 @@ +parameters: + paths: + - src + level: 7 + excludes_analyse: + - %currentWorkingDirectory%/_example