Skip to content
Snippets Groups Projects
Commit ecb35b5e authored by Camille Simiand's avatar Camille Simiand Committed by Sebastien
Browse files

Improve phpstan configuration and install phpstan-phpunit dependency

parent 2a2bff75
Branches
Tags
3 merge requests!43tuleap-83-access-my-capsules,!42Draft: access-my-capsules-conflicts-fixed,!40Draft: Tuleap 83 access my capsules
<?php declare(strict_types = 1);
use App\Kernel;
use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Component\Dotenv\Dotenv;
require dirname(__DIR__) . '/../vendor/autoload.php';
(new Dotenv())->bootEnv(dirname(__DIR__) . '/../.env');
$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);
return new Application($kernel);
......@@ -53,11 +53,13 @@
"twig/twig": "^2.12|^3.0"
},
"require-dev": {
"ext-dom": "*",
"dama/doctrine-test-bundle": "^6.7",
"doctrine/doctrine-fixtures-bundle": "^3.4",
"phpstan/extension-installer": "^1.1",
"phpstan/phpstan": "^1.2",
"phpstan/phpstan": "^1.3",
"phpstan/phpstan-doctrine": "^1.0",
"phpstan/phpstan-phpunit": "^1.0",
"phpstan/phpstan-symfony": "^1.0",
"phpunit/phpunit": "^9.5",
"squizlabs/php_codesniffer": "*",
......@@ -67,8 +69,7 @@
"symfony/maker-bundle": "^1.0",
"symfony/phpunit-bridge": "^5.3",
"symfony/stopwatch": "5.3.*",
"symfony/web-profiler-bundle": "5.3.*",
"ext-dom": "*"
"symfony/web-profiler-bundle": "5.3.*"
},
"config": {
"optimize-autoloader": true,
......@@ -117,8 +118,15 @@
"tests": "php ./vendor/bin/phpunit",
"phpcs": "php ./vendor/bin/phpcs src/ tests/",
"phpcbf": "php ./vendor/bin/phpcbf src/ tests/",
"phpstan": "php -d memory_limit=4G vendor/bin/phpstan analyse src/ tests/unit/ tests/functional/ -l 1",
"php-cs-fixer": "tools/php-cs-fixer/vendor/bin/php-cs-fixer fix src/ tests/unit/ tests/functional/"
"phpstan": [
"@php bin/console cache:warmup --env=dev",
"@php bin/console cache:warmup --env=test",
"@phpstan-general",
"@phpstan-tests"
],
"phpstan-general": "phpstan analyse -c phpstan.neon -l 1 src --memory-limit=4G",
"phpstan-tests": "phpstan analyse -c phpstan-tests.neon -l 1 tests --memory-limit=4G",
"php-cs-fixer": "tools/php-cs-fixer/vendor/bin/php-cs-fixer fix src/ tests/"
},
"conflict": {
"symfony/symfony": "*"
......
This diff is collapsed.
parameters:
symfony:
container_xml_path: var/cache/test/App_KernelTestDebugContainer.xml
console_application_loader: build/phpstan/console-loader.php
doctrine:
objectManagerLoader: tests/ObjectManager.php
\ No newline at end of file
parameters:
symfony:
container_xml_path: var/cache/dev/App_KernelDevDebugContainer.xml
console_application_loader: build/phpstan/console-loader.php
doctrine:
objectManagerLoader: tests/ObjectManager.php
\ No newline at end of file
<?php
use App\Kernel;
use Symfony\Component\Dotenv\Dotenv;
require dirname(__DIR__) . '/vendor/autoload.php';
(new Dotenv())->bootEnv(dirname(__DIR__) . '/../.env');
$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);
$kernel->boot();
return $kernel->getContainer()->get('doctrine')->getManager();
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment