feat: add HasCompositePrimaryKey trait for composite primary key support
- Introduced a new trait `HasCompositePrimaryKey` to enable Eloquent models to handle composite primary keys, which are not supported natively by Eloquent. The trait requires models to implement a method to define the composite key columns and manages key retrieval for save and select queries. chore: add GrumPHP configuration for pre-commit checks - Added a `grumphp.yml` configuration file to enforce code style and static analysis checks before commits. This setup includes Laravel Pint for code style and Larastan for static analysis, ensuring code quality and consistency. chore: create PHPStan configuration file - Created a `phpstan.neon` file to configure PHPStan with Larastan for static analysis. The configuration specifies the paths to analyze and sets the analysis level to 5 for a balance between catching bugs and avoiding excessive strictness.
This commit is contained in:
+26
@@ -0,0 +1,26 @@
|
||||
# Configuration GrumPHP : vérifications automatiques avant chaque commit.
|
||||
# À chaque `git commit`, GrumPHP lance ces tâches ; si l'une échoue,
|
||||
# le commit est annulé. On évite ainsi de pousser du code non formaté
|
||||
# ou contenant des erreurs détectables statiquement (= CI qui reste verte).
|
||||
grumphp:
|
||||
# On laisse le temps aux analyses (Larastan peut être un peu long).
|
||||
process_timeout: 120
|
||||
|
||||
# On n'arrête pas au premier échec : on veut voir TOUS les problèmes
|
||||
# (Pint ET PHPStan) en une seule fois.
|
||||
stop_on_failure: false
|
||||
|
||||
tasks:
|
||||
# 1) Style de code (Laravel Pint) — mêmes règles qu'en CI.
|
||||
shell:
|
||||
scripts:
|
||||
- ['-c', 'vendor/bin/pint --test']
|
||||
|
||||
# 2) Analyse statique (Larastan / PHPStan) — détecte les vrais bugs.
|
||||
phpstan:
|
||||
configuration: phpstan.neon
|
||||
# false => on analyse les chemins définis dans phpstan.neon (app/)
|
||||
# plutôt que seulement les fichiers modifiés : analyse plus fiable.
|
||||
use_grumphp_paths: false
|
||||
# Larastan charge tout le framework : 128M par défaut ne suffit pas.
|
||||
memory_limit: '512M'
|
||||
Reference in New Issue
Block a user