Download the PHP package mtarld/symbok-bundle without Composer
On this page you can find all versions of the php package mtarld/symbok-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mtarld/symbok-bundle
More information about mtarld/symbok-bundle
Files in mtarld/symbok-bundle
Informations about the package symbok-bundle
:warning: Status: Archived
With PHP 8.1 and the emergence of public readonly properties, this bundle repository has been archived and is no longer maintained.
If you really need to generate getters and setters generation, you can have a look at lombok-php.
Symbok Annotation Bundle
Runtime code generator bundle for Symfony.
- Detects classes that are using Symbok annotations, generates related methods and loads generated class instead of the original one.
- Stores generated classes in Symfony cache so that Symbok compiles them just once.
- Reads basic Doctrine annotations to handle property's type, nullable status and entity relation.
Initially inspired by Plumbok.
Compatible with Symfony 4 and 5
Symbok ?
:wave: Bye bye endless PHP classes !
Symbok provides annotations in order to generate on the fly predictable and repetitive methods.
Available annotations are:
- AllArgsConstructor
- Data
- ToString
- Getter
- Setter
- Nullable
Symbok also parses doctrine properties annotations such as Column
,
JoinColumn
, OneToOne
, OneToMany
, ManyToOne
, ManyToMany
in order to
automatically discover property type, nullable status and adapt generated methods.
You'll be able to find more precise information on Symbok Bundle in the documentation
Getting started
Installation
You can easily install Symbok by composer
Then, bundle should be registered. Just verify that config\bundles.php
is containing :
Configuration
Once Symbok is installed, you should configure it to fit your needs.
To do so, edit config/packages/symbok.yaml
And you're ready to go ! :rocket:
Basic example
Register your namespace in config file
Then edit your class by adding annotations
Then, the class will be executed as the following:
Provided commands
Updating original files with symbok:update:classes
When running this command, original classes' docblock will be updated with
good @method
tags so that IDEs will be able to know that new methods exist.
For instance, the class:
Will be rewritten as:
Previewing results with symbok:preview
By using that command, you will be able preview Symbok compilation results directly in your CLI.
Compilation strategy represents which compilation will be applied on target class. It could be either:
runtime
to preview PHP code that will be executed at runtimesaved
to preview PHP code that will be written when usingsymbok:update:classes
command
Documentation
A detailed documentation is available here
Contributing
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
After writing your fix/feature, you can run following commands to make sure that everyting is still ok.
Authors
- Mathias Arlaud - mtarld - mathias(dot)arlaud@gmail(dot)com
All versions of symbok-bundle with dependencies
nikic/php-parser Version ^4.2
phpdocumentor/reflection-docblock Version ^4.3|^5.0
doctrine/annotations Version ^1.8
doctrine/collections Version ^1.5
doctrine/dbal Version ^2.9
doctrine/orm Version ^2.7
symfony/inflector Version ^5.0