Une application SaaS éducative nécessite une séparation stricte des données entre établissements scolaires. L'architecture multi-tenant par sous-domaine (ecole-alpha.classeo.local) permet cette isolation tout en utilisant une base de code unique. Le choix d'une résolution basée sur les sous-domaines plutôt que sur des headers ou tokens facilite le routage au niveau infrastructure (reverse proxy) et offre une UX plus naturelle où chaque école accède à "son" URL dédiée.
63 lines
1.9 KiB
PHP
63 lines
1.9 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
$finder = (new PhpCsFixer\Finder())
|
|
->in(__DIR__)
|
|
->exclude('var')
|
|
->exclude('vendor')
|
|
// Fichiers auto-générés par Symfony/Doctrine
|
|
->notPath('config/bundles.php')
|
|
->notPath('config/preload.php')
|
|
->notPath('config/reference.php')
|
|
->notPath('src/DataFixtures/AppFixtures.php')
|
|
// Exclusions spécifiques
|
|
->notPath('src/Shared/Domain/AggregateRoot.php')
|
|
->notPath('src/Shared/Domain/EntityId.php')
|
|
// Classes that need to be mocked in tests (cannot be final)
|
|
->notPath('src/Shared/Infrastructure/Tenant/TenantResolver.php')
|
|
;
|
|
|
|
return (new PhpCsFixer\Config())
|
|
->setRules([
|
|
'@Symfony' => true,
|
|
'@Symfony:risky' => true,
|
|
'declare_strict_types' => true,
|
|
'strict_param' => true,
|
|
'array_syntax' => ['syntax' => 'short'],
|
|
'ordered_imports' => ['sort_algorithm' => 'alpha'],
|
|
'no_unused_imports' => true,
|
|
'not_operator_with_successor_space' => false,
|
|
'trailing_comma_in_multiline' => true,
|
|
'phpdoc_order' => true,
|
|
'phpdoc_separation' => true,
|
|
'phpdoc_no_empty_return' => true,
|
|
'native_function_invocation' => [
|
|
'include' => ['@compiler_optimized'],
|
|
'scope' => 'namespaced',
|
|
'strict' => true,
|
|
],
|
|
'native_constant_invocation' => true,
|
|
'global_namespace_import' => [
|
|
'import_classes' => true,
|
|
'import_constants' => true,
|
|
'import_functions' => true,
|
|
],
|
|
'final_class' => true,
|
|
'class_definition' => [
|
|
'single_line' => true,
|
|
],
|
|
'concat_space' => [
|
|
'spacing' => 'one',
|
|
],
|
|
'single_line_throw' => false,
|
|
// NO Yoda conditions
|
|
'yoda_style' => false,
|
|
'blank_line_before_statement' => [
|
|
'statements' => ['return', 'throw', 'try'],
|
|
],
|
|
])
|
|
->setRiskyAllowed(true)
|
|
->setFinder($finder)
|
|
;
|