10000 Merge branch '2.7' into 2.8 · colinodell/symfony-docs@4cbb891 · GitHub
[go: up one dir, main page]

Skip to content

Commit 4cbb891

Browse files
committed
Merge branch '2.7' into 2.8
* 2.7: Fix the command for validating the schema Fix typo in Doctrine doc revise deprecated bowerphp link Use the international signup page instead of the local one Update sing up link to the Azure cloud plattform Add missing use statement Reworded some explanations and expanded examples Fixed typo - changed it's to its Use preferred spelling for "cannot" Fix explanation of custom placeholder Fix invalid ProgressBar message examples
2 parents 25a6e7a + cd2ec4f commit 4cbb891

File tree

14 files changed

+48
-45
lines changed

14 files changed

+48
-45
lines changed

components/console/helpers/dialoghelper.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ You can also ask and validate a hidden response::
156156

157157
$validator = function ($value) {
158158
if ('' === trim($value)) {
159-
throw new \Exception('The password can not be empty');
159+
throw new \Exception('The password cannot be empty');
160160
}
161161

162162
return $value;

components/console/helpers/progressbar.rst

Lines changed: 34 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ current progress of the bar. Here is a list of the built-in placeholders:
164164
* ``remaining``: The remaining time to complete the task (not available if no max is defined);
165165
* ``estimated``: The estimated time to complete the task (not available if no max is defined);
166166
* ``memory``: The current memory usage;
167-
* ``message``: The current message attached to the progress bar.
167+
* ``message``: used to display arbitrary messages in the progress bar (as explained later).
168168

169169
For instance, here is how you could set the format to be the same as the
170170
``debug`` one::
@@ -175,20 +175,6 @@ Notice the ``:6s`` part added to some placeholders? That's how you can tweak
175175
the appearance of the bar (formatting and alignment). The part after the colon
176176
(``:``) is used to set the ``sprintf`` format of the string.
177177

178-
The ``message`` placeholder is a bit special as you must set the value
179-
yourself::
180-
181-
$bar->setMessage('Task starts');
182-
$bar->start();
183-
184-
$bar->setMessage('Task in progress...');
185-
$bar->advance();
186-
187-
// ...
188-
189-
$bar->setMessage('Task is finished');
190-
$bar->finish();
191-
192178
Instead of setting the format for a given instance of a progress bar, you can
193179
also define global formats::
194180

@@ -299,25 +285,41 @@ that displays the number of remaining steps::
299285
Custom Messages
300286
~~~~~~~~~~~~~~~
301287

302-
The ``%message%`` placeholder allows you to specify a custom message to be
303-
displayed with the progress bar. But if you need more than one, just define
304-
your own::
288+
Progress bars define a placeholder called ``message`` to display arbitrary
289+
messages. However, none of the built-in formats include that placeholder, so
290+
before displaying these messages, you must define your own custom format::
305291

306-
$bar->setMessage('Task starts');
307-
$bar->setMessage('', 'filename');
308-
$bar->start();
292+
$progressBar = new ProgressBar($output, 100);
293+
$progressBar->setFormatDefinition('custom', ' %current%/%max% -- %message%');
294+
$progressBar->setFormat('custom');
309295

310-
$bar->setMessage('Task is in progress...');
311-
while ($file = array_pop($files)) {
312-
$bar->setMessage($filename, 'filename');
313-
$bar->advance();
314-
}
296+
Now, use the ``setMessage()`` method to set the value of the ``%message%``
297+
placeholder before displaying the progress bar:
315298

316-
$bar->setMessage('Task is finished');
317-
$bar->setMessage('', 'filename');
318-
$bar->finish();
299+
// ...
300+
$progressBar->setMessage('Start');
301+
$progressBar->start();
302+
// 0/100 -- Start
303+
304+
$progressBar->advance();
305+
$progressBar->setMessage('Task is in progress...');
306+
// 1/100 -- Task is in progress...
307+
308+
Messages can be combined with custom placeholders too. In this example, the
309+
progress bar uses the ``%message%`` and ``%filename%`` placeholders::
319310

320-
For the ``filename`` to be part of the progress bar, just add the
321-
``%filename%`` placeholder in your format::
311+
$progressBar = new ProgressBar($output, 100);
312+
$progressBar->setFormatDefinition('custom', ' %current%/%max% -- %message% (%filename%)');
313+
$progressBar->setFormat('custom');
322314

323-
$bar->setFormat(" %message%\n %current%/%max%\n Working on %filename%");
315+
The ``setMessage()`` method accepts a second optional argument to set the value
316+
of the custom placeholders::
317+
318+
// ...
319+
// $files = array('client-001/invoices.xml', '...');
320+
foreach ($files as $filename) {
321+
$progressBar->setMessage('Importing invoices...');
322+
$progressBar->setMessage($filename, 'filename');
323+
$progressBar->advance();
324+
// 2/100 -- Importing invoices... (client-001/invoices.xml)
325+
}

components/console/helpers/questionhelper.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ You can also use a validator with a hidden question::
299299
$question = new Question('Please enter your password');
300300
$question->setValidator(function ($value) {
301301
if (trim($value) == '') {
302-
throw new \Exception('The password can not be empty');
302+
throw new \Exception('The password cannot be empty');
303303
}
304304

305305
return $value;

components/process.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ Use :method:`Symfony\\Component\\Process\\Process::disableOutput` and
323323

324324
.. caution::
325325

326-
You can not enable or disable the output while the process is running.
326+
You cannot enable or disable the output while the process is running.
327327

328328
If you disable the output, you cannot access ``getOutput()``,
329329
``getIncrementalOutput()``, ``getErrorOutput()`` or ``getIncrementalErrorOutput()``.

components/var_dumper.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ of your application may just break it by e.g. sending HTTP headers or
8888
corrupting your view, the bundle configures the ``dump()`` function so that
8989
variables are dumped in the web debug toolbar.
9090

91-
But if the toolbar can not be displayed because you e.g. called ``die``/``exit``
91+
But if the toolbar cannot be displayed because you e.g. called ``die``/``exit``
9292
or a fatal error occurred, then dumps are written on the regular output.
9393

9494
In a Twig template, two constructs are available for dumping a variable.

controller/soap_web_service.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ How to Create a SOAP Web Service in a Symfony Controller
88

99
Setting up a controller to act as a SOAP server is simple with a couple
1010
tools. You must, of course, have the `PHP SOAP`_ extension installed.
11-
As the PHP SOAP extension can not currently generate a WSDL, you must either
11+
As the PHP SOAP extension cannot currently generate a WSDL, you must either
1212
create one from scratch or use a 3rd party generator.
1313

1414
.. note::

deployment/azure-website.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ and executed on a Microsoft IIS web server. The process is simple and easy
452452
to implement. And as a bonus, Microsoft is continuing to reduce the number
453453
of steps needed so that deployment becomes even easier.
454454

455-
.. _`sign up with Azure`: https://signup.live.com/signup.aspx
455+
.. _`sign up with Azure`: https://azure.microsoft.com/free/
456456
.. _`Azure Portal`: https://portal.azure.com
457457
.. _`PHP MSDN documentation`: http://blogs.msdn.com/b/silverlining/archive/2012/07/10/configuring-php-in-windows-azure-websites-with-user-ini-files.aspx
458458
.. _`git-scm.com`: http://git-scm.com/download

doctrine.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ see the :ref:`doctrine-field-types` section.
389389

390390
.. code-block:: terminal
391391
392-
$ php bin/console doctrine:schema:validate
392+
$ php app/console doctrine:schema:validate
393393
394394
.. _doctrine-generating-getters-and-setters:
395395

doctrine/event_listeners_subscribers.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
How to Register Event Listeners and Subscribers
77
===============================================
88

9-
Doctrine packages a rich event system that fires events when almost anything
9+
Doctrine packages have a rich event system that fires events when almost anything
1010
happens inside the system. For you, this means that you can create arbitrary
1111
:doc:`services </service_container>` and tell Doctrine to notify those
1212
objects whenever a certain action (e.g. ``prePersist()``) happens within Doctrine.
@@ -207,7 +207,7 @@ interface and have an event method for each event it subscribes to::
207207

208208
.. tip::
209209

210-
Doctrine event subscribers can not return a flexible array of methods to
210+
Doctrine event subscribers cannot return a flexible array of methods to
211211
call for the events like the :ref:`Symfony event subscriber <event_dispatcher-using-event-subscribers>`
212212
can. Doctrine event subscribers must return a simple array of the event
213213
names they subscribe to. Doctrine will then expect methods on the subscriber

frontend/bower.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ enough to ensure only bringing in compatible versions.
143143

144144
.. _Bower: http://bower.io
145145
.. _`Node.js`: https://nodejs.org
146-
.. _BowerPHP: http://bowerphp.org/
146+
.. _BowerPHP: https://github.com/Bee-Lab/bowerphp
147147
.. _`Bower documentation`: http://bower.io/
148148
.. _Bootstrap: http://getbootstrap.com/
149149
.. _Gulp: http://gulpjs.com/

reference/forms/types/button.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ The following options are defined in the
2929
:class:`Symfony\\Component\\Form\\Extension\\Core\\Type\\BaseType` class.
3030
The ``BaseType`` class is the parent class for both the ``button`` type
3131
and the :doc:`FormType </reference/forms/types/form>`, but it is not part
32-
of the form type tree (i.e. it can not be used as a form type on its own).
32+
of the form type tree (i.e. it cannot be used as a form type on its own).
3333

3434
.. include:: /reference/forms/types/options/button_attr.rst.inc
3535

reference/forms/types/form.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ The following options are defined in the
147147
:class:`Symfony\\Component\\Form\\Extension\\Core\\Type\\BaseType` class.
148148
The ``BaseType`` class is the parent class for both the ``form`` type and
149149
the :doc:`ButtonType </reference/forms/types/button>`, but it is not part
150-
of the form type tree (i.e. it can not be used as a form type on its own).
150+
of the form type tree (i.e. it cannot be used as a form type on its own).
151151

152152
.. include:: /reference/forms/types/options/attr.rst.inc
153153

routing/redirect_trailing_slash.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ system, as explained below:
4242
// src/AppBundle/Controller/RedirectingController.php
4343
namespace AppBundle\Controller;
4444
45+
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
4546
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
4647
use Symfony\Component\HttpFoundation\Request;
4748

session/php_bridge.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ If you're integrating the Symfony full-stack Framework into a legacy application
1111
that starts the session with ``session_start()``, you may still be able to
1212
use Symfony's session management by using the PHP Bridge session.
1313

14-
If the application has it's own PHP save handler, you can specify null
14+
If the application has its own PHP save handler, you can specify null
1515
for the ``handler_id``:
1616

1717
.. configuration-block::

0 commit comments

Comments
 (0)
0