Skip to content

Commit

Permalink
👷 add pre-commit hook && satify phpstan
Browse files Browse the repository at this point in the history
  • Loading branch information
mcfog committed Jun 29, 2019
1 parent 7d583e1 commit 4f2fba4
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 2 deletions.
11 changes: 11 additions & 0 deletions .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)$
2 changes: 1 addition & 1 deletion RoadRunnerConfiguration.php
Expand Up @@ -4,14 +4,14 @@

namespace Lit\Runner\RoadRunner;

use Http\Factory\Diactoros\ResponseFactory;
use Lit\Air\Configurator as C;
use Lit\Bolt\BoltApp;
use Psr\Http\Message\ResponseFactoryInterface;
use Spiral\Goridge\RelayInterface;
use Spiral\Goridge\StreamRelay;
use Spiral\RoadRunner\PSR7Client;
use Spiral\RoadRunner\Worker;
use Zend\Diactoros\ResponseFactory;

class RoadRunnerConfiguration
{
Expand Down
6 changes: 5 additions & 1 deletion RoadRunnerWorker.php
Expand Up @@ -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);
}

Expand Down
6 changes: 6 additions & 0 deletions composer.json
Expand Up @@ -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"
Expand Down
11 changes: 11 additions & 0 deletions phpcs.xml.dist
@@ -0,0 +1,11 @@
<?xml version="1.0"?>
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/squizlabs/PHP_CodeSniffer/3.3.1/phpcs.xsd">
<file>./</file>
<exclude-pattern>./**/_example/*</exclude-pattern>
<exclude-pattern>./**/Test/*</exclude-pattern>
<exclude-pattern>./vendor/*</exclude-pattern>
<rule ref="PSR1"/>
<rule ref="PSR2"/>
<rule ref="PSR12"/>
</ruleset>
6 changes: 6 additions & 0 deletions phpstan.neon.dist
@@ -0,0 +1,6 @@
parameters:
paths:
- src
level: 7
excludes_analyse:
- %currentWorkingDirectory%/_example

0 comments on commit 4f2fba4

Please sign in to comment.