Skip to content

Commit fe7795f

Browse files
darrylheinxabbuh
authored andcommitted
Minor changes throughout BP for Reusable Bundles
Cleanup and fixes for parts that were difficult to understand
1 parent 8af4575 commit fe7795f

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

bundles/best_practices.rst

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,11 @@ the guides.
2828
Bundle Name
2929
-----------
3030

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``.
3536

3637
A namespace becomes a bundle as soon as you add a bundle class to it. The
3738
bundle class name must follow these simple rules:
@@ -75,7 +76,7 @@ configuration options (see below for some usage examples).
7576
Directory Structure
7677
-------------------
7778

78-
The basic directory structure of an AcmeBlogBundle must read as follows:
79+
The basic directory structure of an ``AcmeBlogBundle`` must read as follows:
7980

8081
.. code-block:: text
8182
@@ -105,15 +106,15 @@ that automated tools can rely on:
105106
bundles are published under the MIT license, but you can `choose any license`_;
106107
* ``Resources/doc/index.rst``: The root file for the Bundle documentation.
107108

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.
110111

111112
The bundle directory is read-only. If you need to write temporary files, store
112113
them under the ``cache/`` or ``log/`` directory of the host application. Tools
113114
can generate files in the bundle directory structure, but only if the generated
114115
files are going to be part of the repository.
115116

116-
The following classes and files have specific emplacements (some are mandatory
117+
The following classes and files have specific emplacements (some are mandatory
117118
and others are just conventions followed by most developers):
118119

119120
=============================== ============================= ================
@@ -138,9 +139,9 @@ Classes
138139
-------
139140

140141
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``.
144145

145146
All classes and files must follow the :doc:`Symfony coding standards </contributing/code/standards>`.
146147

@@ -158,8 +159,8 @@ Vendors
158159
A bundle must not embed third-party PHP libraries. It should rely on the
159160
standard Symfony autoloading instead.
160161

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.
163164

164165
Tests
165166
-----
@@ -185,7 +186,7 @@ All classes and functions must come with full PHPDoc.
185186

186187
Extensive documentation should also be provided in the
187188
: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
189190
the only mandatory file and must be the entry point for the documentation.
190191

191192
Installation Instructions
@@ -232,7 +233,6 @@ following standardized instructions in your ``README.md`` file.
232233
{
233234
$bundles = array(
234235
// ...
235-
236236
new <vendor>\<bundle-name>\<bundle-long-name>(),
237237
);
238238
@@ -399,8 +399,8 @@ The ``composer.json`` file should include at least the following metadata:
399399
``name``
400400
Consists of the vendor and the short bundle name. If you are releasing the
401401
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``
404404
is transformed into ``blog-bundle`` and ``AcmeSocialConnectBundle`` is
405405
transformed into ``social-connect-bundle``.
406406

@@ -412,10 +412,10 @@ The ``composer.json`` file should include at least the following metadata:
412412

413413
``license``
414414
``MIT`` is the preferred license for Symfony bundles, but you can use any
415-
other license.
415+
license.
416416

417417
``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
419419
`PSR-4`_ autoload standard is recommended for modern bundles, but `PSR-0`_
420420
standard is also supported.
421421

0 commit comments

Comments
 (0)