Skip to content

Commit

Permalink
Merge pull request #19 from n-peugnet/check-tools
Browse files Browse the repository at this point in the history
Add phpstan and check composer script
  • Loading branch information
vincent-peugnet committed Jan 8, 2021
2 parents ec2cce8 + 740266a commit 7910d58
Show file tree
Hide file tree
Showing 9 changed files with 296 additions and 26 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# editor files
.vscode/*
!.vscode/extensions.json

###> symfony/framework-bundle ###
/.env.local
Expand All @@ -14,3 +17,4 @@
.phpunit.result.cache
/phpunit.xml
###< symfony/phpunit-bridge ###

8 changes: 8 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"recommendations": [
"felixfbecker.php-debug",
"bmewburn.vscode-intelephense-client",
"levacic.vscode-phpstan",
"st-pham.php-refactor-tool"
]
}
22 changes: 0 additions & 22 deletions .vscode/launch.json

This file was deleted.

8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,10 @@ __G__ is the name of this __Sharable Network Tracker__.

But it's kind of a temporary name.

Alternatives names could be *Argali* or *Urial* as it refers to *Gazelle*, the main inspiration dor this project.
Alternatives names could be *Argali* or *Urial* as it refers to *Gazelle*, the main inspiration dor this project.

## Development

### Run checks

composer check
9 changes: 9 additions & 0 deletions build/console-loader.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php declare(strict_types = 1);

use App\Kernel;
use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Component\Dotenv\Dotenv;

(new Dotenv())->bootEnv(dirname(__DIR__).'/.env');
$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);
return new Application($kernel);
17 changes: 17 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@
},
"require-dev": {
"doctrine/doctrine-fixtures-bundle": "^3.4",
"phpstan/phpstan": "^0.12.65",
"phpstan/phpstan-deprecation-rules": "^0.12.6",
"phpstan/phpstan-phpunit": "^0.12.17",
"phpstan/phpstan-symfony": "^0.12.12",
"symfony/browser-kit": "^5.2",
"symfony/css-selector": "^5.2",
"symfony/debug-bundle": "^5.2",
Expand Down Expand Up @@ -86,6 +90,19 @@
"cache:clear": "symfony-cmd",
"assets:install %PUBLIC_DIR%": "symfony-cmd"
},
"check": [
"@phpstan",
"@check-symfony"
],
"check-symfony": [
"@php bin/console --ansi lint:container",
"@php bin/console --ansi lint:twig",
"@php bin/console --ansi doctrine:schema:validate --skip-sync"
],
"phpstan": [
"@php bin/console cache:warmup -q",
"phpstan analyse --ansi"
],
"post-install-cmd": [
"@auto-scripts"
],
Expand Down
226 changes: 223 additions & 3 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
includes:
- vendor/phpstan/phpstan-symfony/extension.neon
- vendor/phpstan/phpstan-symfony/rules.neon
- vendor/phpstan/phpstan-phpunit/extension.neon
- vendor/phpstan/phpstan-deprecation-rules/rules.neon

parameters:
level: 5
paths:
- src
- tests
excludes_analyse:
- vendor/*
symfony:
container_xml_path: var/cache/dev/App_KernelDevDebugContainer.xml
console_application_loader: build/console-loader.php
12 changes: 12 additions & 0 deletions symfony.lock
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,18 @@
"phpdocumentor/type-resolver": {
"version": "1.4.0"
},
"phpstan/phpstan": {
"version": "0.12.65"
},
"phpstan/phpstan-deprecation-rules": {
"version": "0.12.6"
},
"phpstan/phpstan-phpunit": {
"version": "0.12.17"
},
"phpstan/phpstan-symfony": {
"version": "0.12.12"
},
"psr/cache": {
"version": "1.0.1"
},
Expand Down

0 comments on commit 7910d58

Please sign in to comment.