@@ -28,10 +28,11 @@ the guides.
28
28
Bundle Name
29
29
-----------
30
30
31
- A bundle is also a PHP namespace. The namespace must follow the `PSR-0 `_ or
32
- `PSR-4 `_ interoperability standards for PHP namespaces and class names: it starts
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.
31
+ A bundle name is also a PHP namespace. The namespace must follow the `PSR-0 `_
32
+ or `PSR-4 `_ interoperability standards for PHP namespaces and class names.
33
+ The name starts with the vendor name, followed by zero or more category
34
+ segments/names, and it ends with the namespace short name which must end
35
+ with ``Bundle ``.
35
36
36
37
A namespace becomes a bundle as soon as you add a bundle class to it. The
37
38
bundle class name must follow these simple rules:
@@ -75,7 +76,7 @@ configuration options (see below for some usage examples).
75
76
Directory Structure
76
77
-------------------
77
78
78
- The basic directory structure of an AcmeBlogBundle must read as follows:
79
+ The basic directory structure of an `` AcmeBlogBundle `` must read as follows:
79
80
80
81
.. code-block :: text
81
82
@@ -105,15 +106,15 @@ that automated tools can rely on:
105
106
bundles are published under the MIT license, but you can `choose any license `_;
106
107
* ``Resources/doc/index.rst ``: The root file for the Bundle documentation.
107
108
108
- The depth of sub-directories should be kept to the minimum for most used
109
- classes and files (two levels maximum) .
109
+ The depth of subdirectories should be kept to a minimum for the most used
110
+ classes and files. Two levels is the maximum.
110
111
111
112
The bundle directory is read-only. If you need to write temporary files, store
112
113
them under the ``cache/ `` or ``log/ `` directory of the host application. Tools
113
114
can generate files in the bundle directory structure, but only if the generated
114
115
files are going to be part of the repository.
115
116
116
- The following classes and files have specific emplacements (some are mandatory
117
+ The following classes and files have specific emplacements (some are mandatory
117
118
and others are just conventions followed by most developers):
118
119
119
120
=============================== ============================= ================
@@ -138,9 +139,9 @@ Classes
138
139
-------
139
140
140
141
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 ``.
142
+ instance, a ``ContentController `` controller which is stored in
143
+ ``Acme/BlogBundle/Controller/ContentController.php `` would have the fully
144
+ qualified class name of ``Acme\BlogBundle\Controller\ContentController ``.
144
145
145
146
All classes and files must follow the :doc: `Symfony coding standards </contributing/code/standards >`.
146
147
@@ -158,8 +159,8 @@ Vendors
158
159
A bundle must not embed third-party PHP libraries. It should rely on the
159
160
standard Symfony autoloading instead.
160
161
161
- A bundle should not embed third-party libraries written in JavaScript, CSS or
162
- any other language.
162
+ A bundle should also not embed third-party libraries written in JavaScript,
163
+ CSS or any other language.
163
164
164
165
Tests
165
166
-----
@@ -185,7 +186,7 @@ All classes and functions must come with full PHPDoc.
185
186
186
187
Extensive documentation should also be provided in the
187
188
:doc: `reStructuredText </contributing/documentation/format >` format, under
188
- the ``Resources/doc/ `` directory; the ``Resources/doc/index.rst `` file is
189
+ the ``Resources/doc/ `` directory. The ``Resources/doc/index.rst `` file is
189
190
the only mandatory file and must be the entry point for the documentation.
190
191
191
192
Installation Instructions
@@ -232,7 +233,6 @@ following standardized instructions in your ``README.md`` file.
232
233
{
233
234
$bundles = array(
234
235
// ...
235
-
236
236
new <vendor>\<bundle-name>\<bundle-long-name>(),
237
237
);
238
238
@@ -399,8 +399,8 @@ The ``composer.json`` file should include at least the following metadata:
399
399
``name ``
400
400
Consists of the vendor and the short bundle name. If you are releasing the
401
401
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 ``
402
+ (e.g. ``johnsmith/blog-bundle ``). Exclude the vendor name from the bundle
403
+ short name and separate each word with an hyphen. For example: ``AcmeBlogBundle ``
404
404
is transformed into ``blog-bundle `` and ``AcmeSocialConnectBundle `` is
405
405
transformed into ``social-connect-bundle ``.
406
406
@@ -412,10 +412,10 @@ The ``composer.json`` file should include at least the following metadata:
412
412
413
413
``license ``
414
414
``MIT `` is the preferred license for Symfony bundles, but you can use any
415
- other license.
415
+ license.
416
416
417
417
``autoload ``
418
- This information is used by Symfony to load the classes of the bundle. The
418
+ This information is used by Symfony to load the classes in the bundle. The
419
419
`PSR-4 `_ autoload standard is recommended for modern bundles, but `PSR-0 `_
420
420
standard is also supported.
421
421
0 commit comments