@@ -31,7 +31,7 @@ Bundle Name
31
31
A bundle is also a PHP namespace. The namespace must follow the `PSR-0 `_ or
32
32
`PSR-4 `_ interoperability standards for PHP namespaces and class names: it starts
33
33
with a vendor segment, followed by zero or more category segments, and it ends
34
- with the namespace short name, which must end with a ``Bundle `` suffix .
34
+ with the namespace short name, which must end with ``Bundle ``.
35
35
36
36
A namespace becomes a bundle as soon as you add a bundle class to it. The
37
37
bundle class name must follow these simple rules:
@@ -48,8 +48,8 @@ Here are some valid bundle namespaces and class names:
48
48
========================== ==================
49
49
Namespace Bundle Class Name
50
50
========================== ==================
51
- ``Acme\Bundle\BlogBundle `` `` AcmeBlogBundle ``
52
- ``Acme\BlogBundle `` `` AcmeBlogBundle ``
51
+ ``Acme\Bundle\BlogBundle `` AcmeBlogBundle
52
+ ``Acme\BlogBundle `` AcmeBlogBundle
53
53
========================== ==================
54
54
55
55
By convention, the ``getName() `` method of the bundle class should return the
@@ -58,8 +58,7 @@ class name.
58
58
.. note ::
59
59
60
60
If you share your bundle publicly, you must use the bundle class name as
61
- the name of the repository (``AcmeBlogBundle `` and not ``BlogBundle ``
62
- for instance).
61
+ the name of the repository (AcmeBlogBundle and not BlogBundle for instance).
63
62
64
63
.. note ::
65
64
@@ -68,7 +67,7 @@ class name.
68
67
:class: `Symfony\\ Bundle\\ FrameworkBundle\\ FrameworkBundle `.
69
68
70
69
Each bundle has an alias, which is the lower-cased short version of the bundle
71
- name using underscores (``acme_blog `` for `` AcmeBlogBundle `` ). This alias
70
+ name using underscores (``acme_blog `` for AcmeBlogBundle). This alias
72
71
is used to enforce uniqueness within a project and for defining bundle's
73
72
configuration options (see below for some usage examples).
74
73
@@ -105,8 +104,8 @@ that automated tools can rely on:
105
104
bundles are published under the MIT license, but you can `choose any license `_;
106
105
* ``Resources/doc/index.rst ``: The root file for the Bundle documentation.
107
106
108
- The depth of sub-directories should be kept to the minimum for most used
109
- classes and files (two levels maximum) .
107
+ The depth of subdirectories should be kept to a minimum for the most used
108
+ classes and files. Two levels is the maximum.
110
109
111
110
The bundle directory is read-only. If you need to write temporary files, store
112
111
them under the ``cache/ `` or ``log/ `` directory of the host application. Tools
@@ -138,9 +137,9 @@ Classes
138
137
-------
139
138
140
139
The bundle directory structure is used as the namespace hierarchy. For
141
- instance, a ``ContentController `` controller is stored in
142
- ``Acme/BlogBundle/Controller/ContentController.php `` and the fully qualified
143
- class name is ``Acme\BlogBundle\Controller\ContentController ``.
140
+ instance, a ``ContentController `` controller which is stored in
141
+ ``Acme/BlogBundle/Controller/ContentController.php `` would have the fully
142
+ qualified class name of ``Acme\BlogBundle\Controller\ContentController ``.
144
143
145
144
All classes and files must follow the :doc: `Symfony coding standards </contributing/code/standards >`.
146
145
@@ -158,8 +157,8 @@ Vendors
158
157
A bundle must not embed third-party PHP libraries. It should rely on the
159
158
standard Symfony autoloading instead.
160
159
161
- A bundle should not embed third-party libraries written in JavaScript, CSS or
162
- any other language.
160
+ A bundle should also not embed third-party libraries written in JavaScript,
161
+ CSS or any other language.
163
162
164
163
Tests
165
164
-----
@@ -183,10 +182,13 @@ Documentation
183
182
184
183
All classes and functions must come with full PHPDoc.
185
184
186
- Extensive documentation should also be provided in the
187
- :doc: `reStructuredText </contributing/documentation/format >` format, under
188
- the ``Resources/doc/ `` directory; the ``Resources/doc/index.rst `` file is
189
- the only mandatory file and must be the entry point for the documentation.
185
+ Extensive documentation should also be provided in the ``Resources/doc/ ``
186
+ directory.
187
+ The index file (for example ``Resources/doc/index.rst `` or
188
+ ``Resources/doc/index.md ``) is the only mandatory file and must be the entry
189
+ point for the documentation. The
190
+ :doc: `reStructuredText (rST) </contributing/documentation/format >` is the format
191
+ used to render the documentation on symfony.com.
190
192
191
193
Installation Instructions
192
194
~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -232,7 +234,6 @@ following standardized instructions in your ``README.md`` file.
232
234
{
233
235
$bundles = array(
234
236
// ...
235
-
236
237
new <vendor>\<bundle-name>\<bundle-long-name>(),
237
238
);
238
239
@@ -399,9 +400,9 @@ The ``composer.json`` file should include at least the following metadata:
399
400
``name ``
400
401
Consists of the vendor and the short bundle name. If you are releasing the
401
402
bundle on your own instead of on behalf of a company, use your personal name
402
- (e.g. ``johnsmith/blog-bundle ``). The bundle short name excludes the vendor
403
- name and separates each word with an hyphen. For example: `` AcmeBlogBundle ``
404
- is transformed into ``blog-bundle `` and `` AcmeSocialConnectBundle `` is
403
+ (e.g. ``johnsmith/blog-bundle ``). Exclude the vendor name from the bundle
404
+ short name and separate each word with an hyphen. For example: AcmeBlogBundle
405
+ is transformed into ``blog-bundle `` and AcmeSocialConnectBundle is
405
406
transformed into ``social-connect-bundle ``.
406
407
407
408
``description ``
@@ -411,8 +412,7 @@ The ``composer.json`` file should include at least the following metadata:
411
412
Use the ``symfony-bundle `` value.
412
413
413
414
``license ``
414
- ``MIT `` is the preferred license for Symfony bundles, but you can use any
415
- other license.
415
+ a string (or array of strings) with a `valid license identifier `_, such as ``MIT ``.
416
416
417
417
``autoload ``
418
418
This information is used by Symfony to load the classes of the bundle. The
@@ -497,3 +497,4 @@ Learn more
497
497
.. _`Semantic Versioning Standard` : http://semver.org/
498
498
.. _`Packagist` : https://packagist.org/
499
499
.. _`choose any license` : http://choosealicense.com/
500
+ .. _`valid license identifier` : https://spdx.org/licenses/
0 commit comments