Skip to content

Commit 05d9b21

Browse files
committed
[docs] document new config values
1 parent f8175a2 commit 05d9b21

File tree

1 file changed

+63
-10
lines changed

1 file changed

+63
-10
lines changed

src/Resources/doc/index.rst

Lines changed: 63 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ The Symfony MakerBundle
33

44
Symfony Maker helps you create empty commands, controllers, form classes,
55
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
77
commands can generate code into any application.
88

99
Installation
@@ -65,18 +65,71 @@ file by their respective environment variables:
6565
Configuration
6666
-------------
6767

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:
7070

7171
.. 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
7278
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
80133

81134
Creating your Own Makers
82135
------------------------

0 commit comments

Comments
 (0)