@@ -3,7 +3,7 @@ The Symfony MakerBundle
3
3
4
4
Symfony Maker helps you create empty commands, controllers, form classes,
5
5
tests and more so you can forget about writing boilerplate code. This bundle
6
- assumes you're using a standard Symfony 5 directory structure, but many
6
+ assumes you're using a standard Symfony 6.4 directory structure, but many
7
7
commands can generate code into any application.
8
8
9
9
Installation
@@ -65,18 +65,71 @@ file by their respective environment variables:
65
65
Configuration
66
66
-------------
67
67
68
- This bundle doesn't require any configuration. But, you *can * configure
69
- the root namespace that is used to "guess" what classes you want to generate :
68
+ This bundle doesn't require any configuration. But, you *can * override the default
69
+ configuration :
70
70
71
71
.. code-block :: yaml
72
+ # config/packages/maker.yaml
73
+ when@dev :
74
+ maker :
75
+ root_namespace : ' App'
76
+ generate_final_classes : true
77
+ generate_final_entities : false
72
78
73
- # config/packages/dev/maker.yaml
74
- # create this file if you need to configure anything
75
- maker :
76
- # tell MakerBundle that all of your classes live in an
77
- # Acme namespace, instead of the default App
78
- # (e.g. Acme\Entity\Article, Acme\Command\MyCommand, etc)
79
- root_namespace : ' Acme'
79
+ root_namespace
80
+ ~~~~~~~~~~~~~~
81
+
82
+ **type **: ``string `` **default **: ``App ``
83
+
84
+ The root namespace used when generating all of your classes
85
+ (e.g. ``App\Entity\Article ``, ``App\Command\MyCommand ``, etc). Changing
86
+ this to ``Acme `` would cause MakerBundle to create new classes like
87
+ (e.g. ``Acme\Entity\Article ``, ``Acme\Command\MyCommand ``, etc).
88
+
89
+ generate_final_classes
90
+ ~~~~~~~~~~~~~~
91
+
92
+ **type **: ``boolean `` **default **: ``true ``
93
+
94
+ By default, MakerBundle will generate all of your classes with the
95
+ ``final `` PHP keyword except for doctrine entities. Set this to ``false ``
96
+ to override this behavior for all maker commands.
97
+
98
+ See https://www.php.net/manual/en/language.oop5.final.php
99
+
100
+ .. code-block :: php
101
+ final class MyVoter
102
+ {
103
+ ...
104
+ }
105
+
106
+ .. versionadded :: 1.60.0
107
+
108
+ ``generate_final_classes `` was introduced in MakerBundle v1.60
109
+
110
+
111
+ generate_final_entities
112
+ ~~~~~~~~~~~~~~
113
+
114
+ **type **: ``boolean `` **default **: ``false ``
115
+
116
+ By default, MakerBundle will not generate any of your doctrine entity
117
+ classes with the ``final `` PHP keyword. Set this to ``true ``
118
+ to override this behavior for all maker commands that create
119
+ entities.
120
+
121
+ See https://www.php.net/manual/en/language.oop5.final.php
122
+
123
+ .. code-block :: php
124
+ #[ORM\Entity(repositoryClass: TaskRepository::class)]
125
+ class Task extends AbstractEntity
126
+ {
127
+ ...
128
+ }
129
+
130
+ .. versionadded :: 1.60.0
131
+
132
+ ``generate_final_entities `` was introduced in MakerBundle v1.60
80
133
81
134
Creating your Own Makers
82
135
------------------------
0 commit comments