8000 Merge branch '2.8' into 3.1 · symfony/symfony-docs@6649288 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6649288

Browse files
committed
Merge branch '2.8' into 3.1
* 2.8: 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 Fix missing key for time-sensitive tests 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 8f4aeb0 + 4cbb891 commit 6649288

File tree

14 files changed

+48
-45
lines changed

14 files changed

+48
-45
lines changed

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
@@ -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
@@ -320,7 +320,7 @@ namespaces in the ``phpunit.xml`` file, as done for example in the
320320
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener">
321321
<arguments>
322322
<array>
323-
<element><string>Symfony\Component\HttpFoundation</string></element>
323+
<element key="time-sensitive"><string>Symfony\Component\HttpFoundation</string></element>
324324
</array>
325325
</arguments>
326326
</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.rst

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

435435
.. code-block:: terminal
436436
437-
$ php bin/console doctrine:schema:validate
437+
$ php app/console doctrine:schema:validate
438438
439439
.. _doctrine-generating-getters-and-setters:
440440

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
@@ -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::

0 commit comments

Comments
 (0)
0