Skip to content

Commit ee31b7f

Browse files
committed
Merge branch '3.2'
* 3.2: [#7410] fix console binary path after merge 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 add missing blank line Fix missing key for time-sensitive tests Possible fix for the broken link for cache Reworded some explanations and expanded examples [#7354] remove an unneeded dot Fixed typo - changed it's to its Use preferred spelling for "cannot" Fixed wording Fix explanation of custom placeholder Fix invalid ProgressBar message examples
2 parents 6fefae1 + a05cbfc commit ee31b7f

File tree

15 files changed

+53
-48
lines changed

15 files changed

+53
-48
lines changed

components/console/helpers/progressbar.rst

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

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

184-
The ``message`` placeholder is a bit special as you must set the value
185-
yourself::
186-
187-
$bar->setMessage('Task starts');
188-
$bar->start();
189-
190-
$bar->setMessage('Task in progress...');
191-
$bar->advance();
192-
193-
// ...
194-
195-
$bar->setMessage('Task is finished');
196-
$bar->finish();
197-
198184
Instead of setting the format for a given instance of a progress bar, you can
199185
also define global formats::
200186

@@ -305,25 +291,41 @@ that displays the number of remaining steps::
305291
Custom Messages
306292
~~~~~~~~~~~~~~~
307293

308-
The ``%message%`` placeholder allows you to specify a custom message to be
309-
displayed with the progress bar. But if you need more than one, just define
310-
your own::
294+
Progress bars define a placeholder called ``message`` to display arbitrary
295+
messages. However, none of the built-in formats include that placeholder, so
296+
before displaying these messages, you must define your own custom format::
311297

312-
$bar->setMessage('Task starts');
313-
$bar->setMessage('', 'filename');
314-
$bar->start();
298+
$progressBar = new ProgressBar($output, 100);
299+
$progressBar->setFormatDefinition('custom', ' %current%/%max% -- %message%');
300+
$progressBar->setFormat('custom');
315301

316-
$bar->setMessage('Task is in progress...');
317-
while ($file = array_pop($files)) {
318-
$bar->setMessage($filename, 'filename');
319-
$bar->advance();
320-
}
302+
Now, use the ``setMessage()`` method to set the value of the ``%message%``
303+
placeholder before displaying the progress bar:
321304

322-
$bar->setMessage('Task is finished');
323-
$bar->setMessage('', 'filename');
324-
$bar->finish();
305+
// ...
306+
$progressBar->setMessage('Start');
307+
$progressBar->start();
308+
// 0/100 -- Start
309+
310+
$progressBar->advance();
311+
$progressBar->setMessage('Task is in progress...');
312+
// 1/100 -- Task is in progress...
313+
314+
Messages can be combined with custom placeholders too. In this example, the
315+
progress bar uses the ``%message%`` and ``%filename%`` placeholders::
325316

326-
For the ``filename`` to be part of the progress bar, just add the
327-
``%filename%`` placeholder in your format::
317+
$progressBar = new ProgressBar($output, 100);
318+
$progressBar->setFormatDefinition('custom', ' %current%/%max% -- %message% (%filename%)');
319+
$progressBar->setFormat('custom');
328320

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

components/console/helpers/questionhelper.rst

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

301301
return $value;

components/phpunit_bridge.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ namespaces in the ``phpunit.xml`` file, as done for example in the
345345
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener">
346346
<arguments>
347347
<array>
348-
<element><string>Symfony\Component\HttpFoundation</string></element>
348+
<element key="time-sensitive"><string>Symfony\Component\HttpFoundation</string></element>
349349
</array>
350350
</arguments>
351351
</listener>

components/process.rst

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

374374
.. caution::
375375

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

378378
If you disable the output, you cannot access ``getOutput()``,
379379
``getIncrementalOutput()``, ``getErrorOutput()``, ``getIncrementalErrorOutput()`` or

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/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/configuration/framework.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ Configuration
105105
* `php_errors`_
106106
* `log`_
107107
* `throw`_
108-
* `cache <reference-cache>`_
108+
* :ref:`cache <reference-cache>`
109109
* `prefix_seed`_
110110

111111
secret
@@ -1489,6 +1489,8 @@ throw
14891489
Throw PHP errors as ``\ErrorException`` instances. The parameter
14901490
``debug.error_handler.throw_at`` controls the threshold.
14911491

1492+
.. _reference-cache:
1493+
14921494
cache
14931495
~~~~~
14941496

reference/forms/types/button.rst

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

3131
.. include:: /reference/forms/types/options/button_attr.rst.inc
3232

reference/forms/types/form.rst

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

136136
.. include:: /reference/forms/types/options/attr.rst.inc
137137

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
@@ -8,7 +8,7 @@ If you're integrating the Symfony full-stack Framework into a legacy application
88
that starts the session with ``session_start()``, you may still be able to
99
use Symfony's session management by using the PHP Bridge session.
1010

11-
If the application has it's own PHP save handler, you can specify null
11+
If the application has its own PHP save handler, you can specify null
1212
for the ``handler_id``:
1313

1414
.. configuration-block::

workflow/usage.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ like this:
156156
will be used.
157157

158158
With this workflow named ``blog_publishing``, you can get help to decide
159-
what actions that are allowed on a blog post. ::
159+
what actions are allowed on a blog post::
160160

161161
$post = new \AppBundle\Entity\BlogPost();
162162

@@ -195,7 +195,7 @@ See example to make sure no blog post without title is moved to "review"::
195195
{
196196
public function guardReview(GuardEvent $event)
197197
{
198-
/** @var Acme\BlogPost $post */
198+
/** @var \AppBundle\Entity\BlogPost $post */
199199
$post = $event->getSubject();
200200
$title = $post->title;
201201

@@ -242,7 +242,7 @@ The links below will only be displayed when the action is allowed:
242242
<a href="...">Reject article</a>
243243
{% endif %}
244244
245-
{# Or loop through the enabled transistions #}
245+
{# Or loop through the enabled transitions #}
246246
{% for transition in workflow_transitions(post) %}
247247
<a href="...">{{ transition.name }}</a>
248248
{% else %}

0 commit comments

Comments
 (0)