tournayrelabs / framework
A framework and helpers on top of Symfony
Requires
- php: >=8.2.22
- aimeos/map: ^3.12
- archtechx/enums: ^1.1
- doctrine/collections: ^1.6 || ^2
- doctrine/orm: ^2.16 || ^3.0
- nesbot/carbon: ^3.0
- nyholm/psr7: ^1.8
- psr/log: ^1.1 || ^2.0 || ^3
- symfony/console: ^6.4 || ^7.4 || ^8.0
- symfony/dependency-injection: ^6.4 || ^7.4 || ^8.0
- symfony/event-dispatcher: ^6.4 || ^7.4 || ^8.0
- symfony/filesystem: ^6.4 || ^7.4 || ^8.0
- symfony/finder: ^6.4 || ^7.4 || ^8.0
- symfony/http-foundation: ^6.4 || ^7.4 || ^8.0
- symfony/http-kernel: ^6.4 || ^7.4 || ^8.0
- symfony/mailer: ^6.4 || ^7.4 || ^8.0
- symfony/messenger: ^6.4 || ^7.4 || ^8.0
- symfony/options-resolver: ^6.4 || ^7.4 || ^8.0
- symfony/process: ^6.4 || ^7.4 || ^8.0
- symfony/routing: ^6.4 || ^7.4 || ^8.0
- symfony/stopwatch: ^6.4 || ^7.4 || ^8.0
- symfony/string: ^6.4 || ^7.4 || ^8.0
- symfony/translation: ^6.4 || ^7.4 || ^8.0
- symfony/twig-bridge: ^6.4 || ^7.4 || ^8.0
- symfony/uid: ^6.4 || ^7.4 || ^8.0
- twig/twig: ^2.13 || ^3.0.4
- webmozart/assert: ^1.11
Requires (Dev)
- atournayre/phpstan-elegant-object: ^0.2
- atournayre/rector-auto-upgrade: ^0.2
- carthage-software/mago: ^1.55
- friendsofphp/php-cs-fixer: ^3.59
- phparkitect/phparkitect: ^0.3.33
- phpstan/extension-installer: ^1.4
- phpstan/phpstan: ^1.11
- phpstan/phpstan-deprecation-rules: ^1.2
- phpstan/phpstan-doctrine: ^1.4
- phpstan/phpstan-phpunit: ^1.4
- phpstan/phpstan-strict-rules: ^1.6
- phpstan/phpstan-webmozart-assert: ^1.2
- phpunit/phpunit: ^9.5
- rector/rector: ^1.1
- rector/swiss-knife: ^0.2.16
- spaze/phpstan-disallowed-calls: ^3.4
- tomasvotruba/lines: ^0.5.1
- tomasvotruba/unused-public: ^0.3.9
Suggests
- phpstan/phpstan: Required to use the shipped rules in TournayreLabs\PHPStan\Rules (^1.11)
- phpstan/phpstan-webmozart-assert: Required to use TournayreLabs\PHPStan\Extension\TournayreLabsAssertTypeSpecifyingExtension (^1.2)
Provides
None
Conflicts
Replaces
None
This package is auto-updated.
Last update: 2026-11-09 23:16:50 UTC
README
Framework and helpers on top of Symfony.
This package is a refactoring of the historical atournayre/framework package.
The original package remains the source of truth while the public surface is
transferred to this repository.
Requirements
- PHP 8.2.22 or higher
- Composer
Installation
composer require tournayrelabs/framework
Development
Install dependencies:
make vendor
Run the default quality checks:
make qa
Useful targets:
make help make composer c='validate --strict' make tests make phpstan make fix
PHPStan rules
The framework ships PHPStan rules that enforce its primitives (tested with PHPStan 1.x, phpstan/phpstan is only a suggest).
Register them in your phpstan.neon. Identifiers and messages are a public contract: baselines index on them.
Every rule takes array<string> $excludedPaths = []: a file is skipped when its path starts with, or contains,
one of the entries. Exceptions: NoNegationOperatorRule (starts with only, use absolute paths such as
%currentWorkingDirectory%/src/Legacy/) and NoBoolReturnOnEntityMethodRule (no excludedPaths).
services: - class: TournayreLabs\PHPStan\Rules\NoForeachRule arguments: excludedPaths: [src/Legacy/] tags: [phpstan.rules.rule] - class: TournayreLabs\PHPStan\Rules\NoEmptyArrayAssignmentRule arguments: excludedPaths: [src/Legacy/] tags: [phpstan.rules.rule] - class: TournayreLabs\PHPStan\Rules\NoNegationOperatorRule arguments: excludedPaths: ['%currentWorkingDirectory%/src/Legacy/'] tags: [phpstan.rules.rule] - class: TournayreLabs\PHPStan\Rules\NoForbiddenLoggerInterfaceRule arguments: excludedPaths: [src/Legacy/] forbiddenNames: # optional, defaults to the two names below - Psr\Log\LoggerInterface - Symfony\Component\HttpKernel\Log\LoggerInterface tags: [phpstan.rules.rule] - class: TournayreLabs\PHPStan\Rules\NoBoolReturnOnEntityMethodRule arguments: methodesLegacy: # frozen list of `Class::method`, never extended - App\Entity\User::isActive tags: [phpstan.rules.rule] - # requires phpstan/phpstan-webmozart-assert class: TournayreLabs\PHPStan\Extension\TournayreLabsAssertTypeSpecifyingExtension tags: [phpstan.typeSpecifier.staticMethodTypeSpecifyingExtension]
| Rule | Identifier | Reports |
|---|---|---|
NoForeachRule |
tournayrelabs.noForeach |
foreach |
NoEmptyArrayAssignmentRule |
tournayrelabs.noEmptyArrayAssignment |
$x = []; |
NoNegationOperatorRule |
tournayrelabs.noNegationOperator |
!$x |
NoForbiddenLoggerInterfaceRule |
tournayrelabs.noForbiddenLoggerInterface |
Psr\Log\LoggerInterface / Symfony\Component\HttpKernel\Log\LoggerInterface used as a name (type hint, extends, new...). A use import alone is not visited by PHPStan, so it is not reported. |
NoBoolReturnOnEntityMethodRule |
tournayrelabs.noBoolReturnOnEntity |
public/protected bool / ?bool method of a Doctrine entity (not private, not overriding a contract, not in methodesLegacy) |
Compatibility
During the initial transfer, method signatures from the original package must be preserved exactly. The implementation may change internally, but public contracts must remain stable for the consuming project.