cisse / symfony-traits-bundle
Symfony Useful Traits
Installs: 15
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- php: ^8.0
- ext-json: *
- doctrine/orm: *
- symfony/http-kernel: ^4.4|^5.0
- symfony/maker-bundle: ^1.0
- symfony/security-bundle: ^4.4|^5.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.19.2
- phpmd/phpmd: ^2.10.2
- squizlabs/php_codesniffer: ^3.6.0
README
Symfony Traits is useful trait that will help you easily create your Symfony entities
Installation
Symfony traits uses Composer.
composer require cisse/symfony-traits-bundle
Usage
<?php require __DIR__.'/vendor/autoload.php'; use Cisse\Bundle\TraitsBundle\Entity\Annotation\NoUnique\Nullable\Text\AddressTrait; use Cisse\Bundle\TraitsBundle\Entity\Annotation\NoUnique\Nullable\Json\RolesTrait; class Foo{ use AddressTrait; // Declaration use RolesTrait { RolesTrait::__construct as private __constructRoles; } // Declaration with constructor alias public function __construct() { $this->__constructRoles(); // Calling constructor from withing trait } } $foo = new Foo(); $foo->setAddress('your address'); // Return $foo. $foo->getAddress(); // Return address
Notes
This component is a work in progress, and it is target for my own usages. But if you like it feel free to use it ;)
Versions
1.0.10