Skip to content

Commit 6b73990

Browse files
committed
Merge branch '2.7'
2 parents 0fb81cc + cd29dde commit 6b73990

15 files changed

+59
-76
lines changed

Diff for: best_practices/business-logic.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -339,4 +339,4 @@ in a matter of seconds.
339339
.. _`PSR-1`: http://www.php-fig.org/psr/psr-1/
340340
.. _`PSR-2`: http://www.php-fig.org/psr/psr-2/
341341
.. _`the Symfony Code Standards`: http://symfony.com/doc/current/contributing/code/standards.html
342-
.. _`PHP-CS-Fixer`: https://github.com/fabpot/PHP-CS-Fixer
342+
.. _`PHP-CS-Fixer`: https://github.com/FriendsOfPHP/PHP-CS-Fixer

Diff for: best_practices/configuration.rst

+8-11
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,9 @@ add an extra layer of configuration that's not needed because you don't need
7474
or want these configuration values to change on each server.
7575

7676
The configuration options defined in the ``config.yml`` file usually vary from
77-
one `execution environment`_ to another. That's why Symfony already includes
78-
``app/config/config_dev.yml`` and ``app/config/config_prod.yml`` files so
79-
that you can override specific values for each environment.
77+
one :doc:`/cookbook/configuration/environments` to another. That's why Symfony
78+
already includes ``app/config/config_dev.yml`` and ``app/config/config_prod.yml``
79+
files so that you can override specific values for each environment.
8080

8181
Constants vs Configuration Options
8282
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -158,10 +158,10 @@ Semantic Configuration: Don't Do It
158158

159159
Don't define a semantic dependency injection configuration for your bundles.
160160

161-
As explained in `How to Expose a semantic Configuration for a Bundle`_ article,
162-
Symfony bundles have two choices on how to handle configuration: normal service
163-
configuration through the ``services.yml`` file and semantic configuration
164-
through a special ``*Extension`` class.
161+
As explained in :doc:`/cookbook/bundles/extension` article, Symfony bundles
162+
have two choices on how to handle configuration: normal service configuration
163+
through the ``services.yml`` file and semantic configuration through a special
164+
``*Extension`` class.
165165

166166
Although semantic configuration is much more powerful and provides nice features
167167
such as configuration validation, the amount of work needed to define that
@@ -174,10 +174,7 @@ Moving Sensitive Options Outside of Symfony Entirely
174174
When dealing with sensitive options, like database credentials, we also recommend
175175
that you store them outside the Symfony project and make them available
176176
through environment variables. Learn how to do it in the following article:
177-
`How to Set external Parameters in the Service Container`_
177+
:doc:`/cookbook/configuration/external_parameters`
178178

179179
.. _`feature toggles`: http://en.wikipedia.org/wiki/Feature_toggle
180-
.. _`execution environment`: http://symfony.com/doc/current/cookbook/configuration/environments.html
181180
.. _`constant() function`: http://twig.sensiolabs.org/doc/functions/constant.html
182-
.. _`How to Expose a semantic Configuration for a Bundle`: http://symfony.com/doc/current/cookbook/bundles/extension.html
183-
.. _`How to Set external Parameters in the Service Container`: http://symfony.com/doc/current/cookbook/configuration/external_parameters.html

Diff for: best_practices/controllers.rst

+1-2
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,6 @@ Pre and Post Hooks
206206
------------------
207207

208208
If you need to execute some code before or after the execution of your controllers,
209-
you can use the EventDispatcher component to `set up before/after filters`_.
209+
you can use the EventDispatcher component to :doc:`/cookbook/event_dispatcher/before_after_filters`.
210210

211211
.. _`ParamConverter`: http://symfony.com/doc/current/bundles/SensioFrameworkExtraBundle/annotations/converters.html
212-
.. _`set up before/after filters`: http://symfony.com/doc/current/cookbook/event_dispatcher/before_after_filters.html

Diff for: best_practices/creating-the-project.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,8 @@ Extending the Directory Structure
220220
---------------------------------
221221

222222
If your project or infrastructure requires some changes to the default directory
223-
structure of Symfony, you can `override the location of the main directories`_:
223+
structure of Symfony, you can
224+
:doc:`override the location of the main directories </cookbook/configuration/override_dir_structure>`:
224225
``cache/``, ``logs/`` and ``web/``.
225226

226227
In addition, Symfony3 will use a slightly different directory structure when
@@ -247,6 +248,5 @@ the Symfony2 directory structure.
247248
.. _`Composer`: https://getcomposer.org/
248249
.. _`Get Started`: https://getcomposer.org/doc/00-intro.md
249250
.. _`Composer download page`: https://getcomposer.org/download/
250-
.. _`override the location of the main directories`: http://symfony.com/doc/current/cookbook/configuration/override_dir_structure.html
251251
.. _`public checksums repository`: https://github.com/sensiolabs/checksums
252252
.. _`these steps`: http://fabien.potencier.org/article/73/signing-project-releases

Diff for: best_practices/forms.rst

+6-9
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,11 @@ To use the class, use ``createForm`` and instantiate the new class:
6969
Registering Forms as Services
7070
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7171

72-
You can also `register your form type as a service`_. But this is *not* recommended
73-
unless you plan to reuse the new form type in many places or embed it in
74-
other forms directly or via the `collection type`_.
72+
You can also
73+
:ref:`register your form type as a service <form-cookbook-form-field-service>`.
74+
But this is *not* recommended unless you plan to reuse the new form type in many
75+
places or embed it in other forms directly or via the
76+
:doc:`collection type </reference/forms/types/collection>`.
7577

7678
For most forms that are used only to edit or create something, registering
7779
the form as a service is over-kill, and makes it more difficult to figure
@@ -169,7 +171,7 @@ fields:
169171

170172
If you need more control over how your fields are rendered, then you should
171173
remove the ``form_widget(form)`` function and render your fields individually.
172-
See `How to Customize Form Rendering`_ for more information on this and how
174+
See :doc:`/cookbook/form/form_customization` for more information on this and how
173175
you can control *how* the form renders at a global level using form theming.
174176

175177
Handling Form Submits
@@ -210,8 +212,3 @@ Second, we recommend using ``$form->isSubmitted()`` in the ``if`` statement
210212
for clarity. This isn't technically needed, since ``isValid()`` first calls
211213
``isSubmitted()``. But without this, the flow doesn't read well as it *looks*
212214
like the form is *always* processed (even on the GET request).
213-
214-
.. _`register your form type as a service`: http://symfony.com/doc/current/cookbook/form/create_custom_field_type.html#creating-your-field-type-as-a-service
215-
.. _`collection type`: http://symfony.com/doc/current/reference/forms/types/collection.html
216-
.. _`How to Customize Form Rendering`: http://symfony.com/doc/current/cookbook/form/form_customization.html
217-
.. _`form event system`: http://symfony.com/doc/current/cookbook/form/dynamic_form_modification.html

Diff for: best_practices/introduction.rst

+1-5
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ Who this Book Is for (Hint: It's not a Tutorial)
5959
Any Symfony developer, whether you are an expert or a newcomer, can read this
6060
guide. But since this isn't a tutorial, you'll need some basic knowledge of
6161
Symfony to follow everything. If you are totally new to Symfony, welcome!
62-
Start with `The Quick Tour`_ tutorial first.
62+
Start with :doc:`The Quick Tour </quick_tour/the_big_picture>` tutorial first.
6363

6464
We've deliberately kept this guide short. We won't repeat explanations that
6565
you can find in the vast Symfony documentation, like discussions about dependency
@@ -95,7 +95,3 @@ practices**. The reasons for not doing it are various:
9595
your tests or adding features that provide real value to the end users.
9696

9797
.. _`Fabien Potencier`: https://connect.sensiolabs.com/profile/fabpot
98-
.. _`The Quick Tour`: http://symfony.com/doc/current/quick_tour/the_big_picture.html
99-
.. _`The Official Symfony Book`: http://symfony.com/doc/current/book/index.html
100-
.. _`The Symfony Cookbook`: http://symfony.com/doc/current/cookbook/index.html
101-
.. _`github.com/.../...`: http://github.com/.../...

Diff for: best_practices/security.rst

+12-19
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ Authentication and Firewalls (i.e. Getting the User's Credentials)
66

77
You can configure Symfony to authenticate your users using any method you
88
want and to load user information from any source. This is a complex topic,
9-
but the `Security Cookbook Section`_ has a lot of information about this.
9+
but the :doc:`Security Cookbook Section </cookbook/security/index>` has a
10+
lot of information about this.
1011

1112
Regardless of your needs, authentication is configured in ``security.yml``,
1213
primarily under the ``firewalls`` key.
@@ -72,8 +73,9 @@ Authorization (i.e. Denying Access)
7273
-----------------------------------
7374

7475
Symfony gives you several ways to enforce authorization, including the ``access_control``
75-
configuration in `security.yml`_, the :ref:`@Security annotation <best-practices-security-annotation>`
76-
and using :ref:`isGranted <best-practices-directy-isGranted>` on the ``security.context``
76+
configuration in :doc:`security.yml </reference/configuration/security>` the
77+
:ref:`@Security annotation <best-practices-security-annotation>` and using
78+
:ref:`isGranted <best-practices-directy-isGranted>` on the ``security.context``
7779
service directly.
7880

7981
.. best-practice::
@@ -240,8 +242,8 @@ Security Voters
240242

241243
If your security logic is complex and can't be centralized into a method
242244
like ``isAuthor()``, you should leverage custom voters. These are an order
243-
of magnitude easier than `ACL's`_ and will give you the flexibility you need
244-
in almost all cases.
245+
of magnitude easier than :doc:`ACL's </cookbook/security/acl>` and will give
246+
you the flexibility you need in almost all cases.
245247

246248
First, create a voter class. The following example shows a voter that implements
247249
the same ``getAuthorEmail`` logic you used above:
@@ -337,27 +339,18 @@ The `FOSUserBundle`_, developed by the Symfony community, adds support for a
337339
database-backed user system in Symfony2. It also handles common tasks like
338340
user registration and forgotten password functionality.
339341

340-
Enable the `Remember Me feature`_ to allow your users to stay logged in for
341-
a long period of time.
342+
Enable the :doc:`Remember Me feature </cookbook/security/remember_me>` to
343+
allow your users to stay logged in for a long period of time.
342344

343345
When providing customer support, sometimes it's necessary to access the application
344346
as some *other* user so that you can reproduce the problem. Symfony provides
345-
the ability to `impersonate users`_.
347+
the ability to :doc:`impersonate users </cookbook/security/impersonating_user>`.
346348

347349
If your company uses a user login method not supported by Symfony, you can
348-
develop `your own user provider`_ and `your own authentication provider`_.
350+
develop :doc:`your own user provider </cookbook/security/custom_provider>` and
351+
:doc:`your own authentication provider </cookbook/security/custom_authentication_provider>`.
349352

350-
.. _`Security Cookbook Section`: http://symfony.com/doc/current/cookbook/security/index.html
351-
.. _`security.yml`: http://symfony.com/doc/current/reference/configuration/security.html
352353
.. _`ParamConverter`: http://symfony.com/doc/current/bundles/SensioFrameworkExtraBundle/annotations/converters.html
353354
.. _`@Security annotation`: http://symfony.com/doc/current/bundles/SensioFrameworkExtraBundle/annotations/security.html
354-
.. _`security.yml`: http://symfony.com/doc/current/reference/configuration/security.html
355-
.. _`security voter`: http://symfony.com/doc/current/cookbook/security/voters_data_permission.html
356-
.. _`Acces Control List`: http://symfony.com/doc/current/cookbook/security/acl.html
357-
.. _`ACL's`: http://symfony.com/doc/current/cookbook/security/acl.html
358355
.. _`expression`: http://symfony.com/doc/current/components/expression_language/introduction.html
359356
.. _`FOSUserBundle`: https://github.com/FriendsOfSymfony/FOSUserBundle
360-
.. _`Remember Me feature`: http://symfony.com/doc/current/cookbook/security/remember_me.html
361-
.. _`impersonate users`: http://symfony.com/doc/current/cookbook/security/impersonating_user.html
362-
.. _`your own user provider`: http://symfony.com/doc/current/cookbook/security/custom_provider.html
363-
.. _`your own authentication provider`: http://symfony.com/doc/current/cookbook/security/custom_authentication_provider.html

Diff for: best_practices/templates.rst

-4
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,5 @@ name is irrelevant because you never use it in your own code):
156156
tags:
157157
- { name: twig.extension }
158158
159-
160159
.. _`Twig`: http://twig.sensiolabs.org/
161160
.. _`Parsedown`: http://parsedown.org/
162-
.. _`Twig global variables`: http://symfony.com/doc/master/cookbook/templating/global_variables.html
163-
.. _`override error pages`: http://symfony.com/doc/current/cookbook/controller/error_pages.html
164-
.. _`render a template without using a controller`: http://symfony.com/doc/current/cookbook/templating/render_without_controller.html

Diff for: best_practices/web-assets.rst

+9-9
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,9 @@ tools like GruntJS.
4949
Use Assetic to compile, combine and minimize web assets, unless you're
5050
comfortable with frontend tools like GruntJS.
5151

52-
`Assetic`_ is an asset manager capable of compiling assets developed with
53-
a lot of different frontend technologies like LESS, Sass and CoffeeScript.
52+
:doc:`Assetic </cookbook/assetic/asset_management>` is an asset manager capable
53+
of compiling assets developed with a lot of different frontend technologies
54+
like LESS, Sass and CoffeeScript.
5455
Combining all your assets with Assetic is a matter of wrapping all the assets
5556
with a single Twig tag:
5657

@@ -86,12 +87,11 @@ separating the repositories if you want).
8687
Learn More about Assetic
8788
------------------------
8889

89-
Assetic can also minimize CSS and JavaScript assets `using UglifyCSS/UglifyJS`_
90-
to speed up your websites. You can even `compress images`_ with Assetic to
91-
reduce their size before serving them to the user. Check out the
92-
`official Assetic documentation`_ to learn more about all the available features.
90+
Assetic can also minimize CSS and JavaScript assets
91+
:doc:`using UglifyCSS/UglifyJS </cookbook/assetic/uglifyjs>` to speed up your
92+
websites. You can even :doc:`compress images </cookbook/assetic/jpeg_optimize>`
93+
with Assetic to reduce their size before serving them to the user. Check out
94+
the `official Assetic documentation`_ to learn more about all the available
95+
features.
9396

94-
.. _`Assetic`: http://symfony.com/doc/current/cookbook/assetic/asset_management.html
95-
.. _`using UglifyCSS/UglifyJS`: http://symfony.com/doc/current/cookbook/assetic/uglifyjs.html
96-
.. _`compress images`: http://symfony.com/doc/current/cookbook/assetic/jpeg_optimize.html
9797
.. _`official Assetic documentation`: https://github.com/kriswallsmith/assetic

Diff for: book/page_creation.rst

+2-3
Original file line numberDiff line numberDiff line change
@@ -897,9 +897,8 @@ The extension alias (configuration key) can also be used:
897897
898898
.. note::
899899

900-
See the cookbook article:
901-
:doc:`How to expose a Semantic Configuration for a Bundle </cookbook/bundles/extension>`
902-
for information on adding configuration for your own bundle.
900+
See the cookbook article: :doc:`/cookbook/bundles/extension` for
901+
information on adding configuration for your own bundle.
903902

904903
.. index::
905904
single: Environments; Introduction

Diff for: book/service_container.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -720,7 +720,7 @@ via a ``container`` variable. Here's another example:
720720
721721
<services>
722722
<service id="my_mailer" class="Acme\HelloBundle\Mailer">
723-
<argument type="expression">@=container.hasParameter('some_param') ? parameter('some_param') : 'default_value'</argument>
723+
<argument type="expression">container.hasParameter('some_param') ? parameter('some_param') : 'default_value'</argument>
724724
</service>
725725
</services>
726726
</container>
@@ -733,7 +733,7 @@ via a ``container`` variable. Here's another example:
733733
$container->setDefinition('my_mailer', new Definition(
734734
'Acme\HelloBundle\Mailer',
735735
array(new Expression(
736-
"@=container.hasParameter('some_param') ? parameter('some_param') : 'default_value'"
736+
"container.hasParameter('some_param') ? parameter('some_param') : 'default_value'"
737737
))
738738
));
739739

Diff for: components/property_access/introduction.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ instead::
327327

328328
$person = new Person();
329329

330-
if ($accessor->isReadable($person, 'firstName') {
330+
if ($accessor->isReadable($person, 'firstName')) {
331331
// ...
332332
}
333333

@@ -338,7 +338,7 @@ method to find out whether a property path can be updated::
338338

339339
$person = new Person();
340340

341-
if ($accessor->isWritable($person, 'firstName') {
341+
if ($accessor->isWritable($person, 'firstName')) {
342342
// ...
343343
}
344344

@@ -392,7 +392,7 @@ configured to enable extra features. To do that you could use the
392392
$accessorBuilder->disableMagicCall();
393393

394394
// Check if magic __call handling is enabled
395-
$accessorBuilder->isMagicCallEnabled() // true or false
395+
$accessorBuilder->isMagicCallEnabled(); // true or false
396396

397397
// At the end get the configured property accessor
398398
$accessor = $accessorBuilder->getPropertyAccessor();
@@ -405,7 +405,7 @@ configured to enable extra features. To do that you could use the
405405
Or you can pass parameters directly to the constructor (not the recommended way)::
406406

407407
// ...
408-
$accessor = new PropertyAccessor(true) // this enables handling of magic __call
408+
$accessor = new PropertyAccessor(true); // this enables handling of magic __call
409409

410410

411411
.. _Packagist: https://packagist.org/packages/symfony/property-access

Diff for: contributing/code/conventions.rst

+1-4
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,4 @@ A PHP ``E_USER_DEPRECATED`` error must also be triggered to help people with
103103
the migration starting one or two minor versions before the version where the
104104
feature will be removed (depending on the criticality of the removal)::
105105

106-
trigger_error(
107-
'XXX() is deprecated since version 2.X and will be removed in 2.Y. Use XXX instead.',
108-
E_USER_DEPRECATED
109-
);
106+
trigger_error('XXX() is deprecated since version 2.X and will be removed in 2.Y. Use XXX instead.', E_USER_DEPRECATED);

Diff for: contributing/code/core_team.rst

+2-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ Active Core Members
6363

6464
* **Jakub Zalas** (:decider:`jakzal`);
6565
* **Jordi Boggiano** (:decider:`seldaek`);
66-
* **Lukas Kahwe Smith** (:decider:`lsmith77`).
66+
* **Lukas Kahwe Smith** (:decider:`lsmith77`);
67+
* **Ryan Weaver** (:decider:`weaverryan`).
6768

6869
Core Membership Application
6970
~~~~~~~~~~~~~~~~~~~~~~~~~~~

Diff for: cookbook/validation/custom_constraint.rst

+8
Original file line numberDiff line numberDiff line change
@@ -230,12 +230,20 @@ With this, the validator ``validate()`` method gets an object as its first argum
230230
public function validate($protocol, Constraint $constraint)
231231
{
232232
if ($protocol->getFoo() != $protocol->getBar()) {
233+
// If you're using the new 2.5 validation API (you probably are!)
234+
$this->context->buildViolation($constraint->message)
235+
->atPath('foo')
236+
->addViolation();
237+
238+
// If you're using the old 2.4 validation API
239+
/*
233240
$this->context->addViolationAt(
234241
'foo',
235242
$constraint->message,
236243
array(),
237244
null
238245
);
246+
*/
239247
}
240248
}
241249
}

0 commit comments

Comments
 (0)