Download the PHP package toovalu-github/doctrine-behaviors without Composer
On this page you can find all versions of the php package toovalu-github/doctrine-behaviors. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download toovalu-github/doctrine-behaviors
More information about toovalu-github/doctrine-behaviors
Files in toovalu-github/doctrine-behaviors
Package doctrine-behaviors
Short Description Doctrine Behavior Traits
License MIT
Homepage http://www.toovalu.com
Informations about the package doctrine-behaviors
Doctrine Behaviors
It's a fork from https://github.com/KnpLabs/DoctrineBehaviors
This PHP library is a collection of traits and interfaces that add behaviors to Doctrine entities and repositories.
It currently handles:
- Blameable
- Sluggable
- SoftDeletable
- Uuidable
- Timestampable
- Translatable
Install
Usage
All you have to do is to define a Doctrine entity:
- implemented interface
- add a trait
For some behaviors like tree, you can use repository traits:
Voilà!
You now have a working Category that behaves like.
PHPStan
A PHPStan extension is available and provides the following features:
- Provides correct return type for
TranslatableInterface::getTranslations()andTranslatableInterface::getNewTranslations() - Provides correct return type for
TranslatableInterface::translate() - Provides correct return type for
TranslationInterface::getTranslatable()
Include phpstan-extension.neon in your project's PHPStan config:
3 Steps to Contribute
- 1 feature per pull-request
- New feature needs tests
- Tests and static analysis must pass:
Upgrade 1.x to 2
There have been many changes between 1 and 2, but don't worry. This package uses Rector, that handles upgrade for you.
Create rector.php config:
Add Doctrine Behaviors upgrade set to rector.php:
Run Rector:
All versions of doctrine-behaviors with dependencies
doctrine/common Version ^3.5.0
doctrine/persistence Version ^4.0.0
doctrine/dbal Version ^4.0.0
doctrine/orm Version ^3.5
doctrine/doctrine-bundle Version ^3.2
symfony/cache Version ^8.0
symfony/dependency-injection Version ^8.0
symfony/http-kernel Version ^8.0
symfony/security-core Version ^8.0
symfony/framework-bundle Version ^8.0
symfony/string Version ^8.0
symfony/translation-contracts Version ^3.0
nette/utils Version ^4
ramsey/uuid Version ^4.2
doctrine/lexer Version ^3.0.0
symfony/security-bundle Version ^8.0
monolog/monolog Version ^3