Skip to content

Commit d8fcd1c

Browse files
committed
Merge branch '2.8' into 3.4
* 2.8: Minor reword in the performance article Always use PHPUnit Bridge to run tests Recommend to never inline PHPDoc blocks Added links to the roadmap of each Symfony version Documented the PhpExecutableFinder utility Fix references to annotation loader tip Make code comments consistent
2 parents 1fff4d4 + ab17874 commit d8fcd1c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+281
-243
lines changed

components/asset.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,13 +121,13 @@ suffix to any asset path::
121121
In case you want to modify the version format, pass a sprintf-compatible format
122122
string as the second argument of the ``StaticVersionStrategy`` constructor::
123123

124-
// put the 'version' word before the version value
124+
// puts the 'version' word before the version value
125125
$package = new Package(new StaticVersionStrategy('v1', '%s?version=%s'));
126126

127127
echo $package->getUrl('/image.png');
128128
// result: /image.png?version=v1
129129

130-
// put the asset version before its path
130+
// puts the asset version before its path
131131
$package = new Package(new StaticVersionStrategy('v1', '%2$s/%1$s'));
132132

133133
echo $package->getUrl('/image.png');

components/class_loader/class_loader.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,13 @@ your classes::
4040
// register a single namespaces
4141
$loader->addPrefix('Symfony', __DIR__.'/vendor/symfony/symfony/src');
4242

43-
// register several namespaces at once
43+
// registers several namespaces at once
4444
$loader->addPrefixes(array(
4545
'Symfony' => __DIR__.'/../vendor/symfony/symfony/src',
4646
'Monolog' => __DIR__.'/../vendor/monolog/monolog/src',
4747
));
4848

49-
// register a prefix for a class following the PEAR naming conventions
49+
// registers a prefix for a class following the PEAR naming conventions
5050
$loader->addPrefix('Twig_', __DIR__.'/vendor/twig/twig/lib');
5151

5252
$loader->addPrefixes(array(

components/console/events.rst

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -37,19 +37,19 @@ dispatched. Listeners receive a
3737
use Symfony\Component\Console\ConsoleEvents;
3838

3939
$dispatcher->addListener(ConsoleEvents::COMMAND, function (ConsoleCommandEvent $event) {
40-
// get the input instance
40+
// gets the input instance
4141
$input = $event->getInput();
4242

43-
// get the output instance
43+
// gets the output instance
4444
$output = $event->getOutput();
4545

46-
// get the command to be executed
46+
// gets the command to be executed
4747
$command = $event->getCommand();
4848

49-
// write something about the command
49+
// writes something about the command
5050
$output->writeln(sprintf('Before running command <info>%s</info>', $command->getName()));
5151

52-
// get the application
52+
// gets the application
5353
$application = $command->getApplication();
5454
});
5555

@@ -68,12 +68,12 @@ C/C++ standard.::
6868
use Symfony\Component\Console\ConsoleEvents;
6969

7070
$dispatcher->addListener(ConsoleEvents::COMMAND, function (ConsoleCommandEvent $event) {
71-
// get the command to be executed
71+
// gets the command to be executed
7272
$command = $event->getCommand();
7373

7474
// ... check if the command can be executed
7575

76-
// disable the command, this will result in the command being skipped
76+
// disables the command, this will result in the command being skipped
7777
// and code 113 being returned from the Application
7878
$event->disableCommand();
7979

@@ -110,10 +110,10 @@ Listeners receive a
110110

111111
$output->writeln(sprintf('Oops, exception thrown while running command <info>%s</info>', $command->getName()));
112112

113-
// get the current exit code (the exception code or the exit code set by a ConsoleEvents::TERMINATE event)
113+
// gets the current exit code (the exception code or the exit code set by a ConsoleEvents::TERMINATE event)
114114
$exitCode = $event->getExitCode();
115115

116-
// change the exception to another one
116+
// changes the exception to another one
117117
$event->setException(new \LogicException('Caught exception', $exitCode, $event->getException()));
118118
});
119119

@@ -149,16 +149,16 @@ Listeners receive a
149149
use Symfony\Component\Console\ConsoleEvents;
150150

151151
$dispatcher->addListener(ConsoleEvents::TERMINATE, function (ConsoleTerminateEvent $event) {
152-
// get the output
152+
// gets the output
153153
$output = $event->getOutput();
154154

155-
// get the command that has been executed
155+
// gets the command that has been executed
156156
$command = $event->getCommand();
157157

158-
// display something
158+
// displays the given content
159159
$output->writeln(sprintf('After running command <info>%s</info>', $command->getName()));
160160

161-
// change the exit code
161+
// changes the exit code
162162
$event->setExitCode(128);
163163
});
164164

components/console/helpers/progressbar.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,24 +15,24 @@ number of units, and advance the progress as the command executes::
1515

1616
use Symfony\Component\Console\Helper\ProgressBar;
1717

18-
// create a new progress bar (50 units)
18+
// creates a new progress bar (50 units)
1919
$progress = new ProgressBar($output, 50);
2020

21-
// start and displays the progress bar
21+
// starts and displays the progress bar
2222
$progress->start();
2323

2424
$i = 0;
2525
while ($i++ < 50) {
2626
// ... do some work
2727

28-
// advance the progress bar 1 unit
28+
// advances the progress bar 1 unit
2929
$progress->advance();
3030

3131
// you can also advance the progress bar by more than 1 unit
3232
// $progress->advance(3);
3333
}
3434

35-
// ensure that the progress bar is at 100%
35+
// ensures that the progress bar is at 100%
3636
$progress->finish();
3737

3838
.. tip::

components/console/helpers/table.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,14 +150,14 @@ If the built-in styles do not fit your need, define your own::
150150
// by default, this is based on the default style
151151
$style = new TableStyle();
152152

153-
// customize the style
153+
// customizes the style
154154
$style
155155
->setHorizontalBorderChar('<fg=magenta>|</>')
156156
->setVerticalBorderChar('<fg=magenta>-</>')
157157
->setCrossingChar(' ')
158158
;
159159

160-
// use the style for this table
160+
// uses the custom style for this table
161161
$table->setStyle($style);
162162

163163
Here is a full list of things you can customize:
@@ -175,10 +175,10 @@ Here is a full list of things you can customize:
175175

176176
You can also register a style globally::
177177

178-
// register the style under the colorful name
178+
// registers the style under the colorful name
179179
Table::setStyleDefinition('colorful', $style);
180180

181-
// use it for a table
181+
// applies the custom style for the given table
182182
$table->setStyle('colorful');
183183

184184
This method can also be used to override a built-in style.

components/dom_crawler.rst

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ An anonymous function can be used to filter with more complex criteria::
8989
$crawler = $crawler
9090
->filter('body > p')
9191
->reduce(function (Crawler $node, $i) {
92-
// filter every other node
92+
// filters every other node
9393
return ($i % 2) == 0;
9494
});
9595

@@ -185,7 +185,7 @@ Accessing Node Values
185185

186186
Access the node name (HTML tag name) of the first node of the current selection (eg. "p" or "div")::
187187

188-
// will return the node name (HTML tag name) of the first child element under <body>
188+
// returns the node name (HTML tag name) of the first child element under <body>
189189
$tag = $crawler->filterXPath('//body/*')->nodeName();
190190

191191
Access the value of the first node of the current selection::
@@ -367,7 +367,7 @@ instance with just the selected link(s). Calling ``link()`` gives you a special
367367
The :class:`Symfony\\Component\\DomCrawler\\Link` object has several useful
368368
methods to get more information about the selected link itself::
369369

370-
// return the proper URI that can be used to make another request
370+
// returns the proper URI that can be used to make another request
371371
$uri = $link->getUri();
372372

373373
.. note::
@@ -441,13 +441,13 @@ attribute followed by a query string of all of the form's values.
441441

442442
You can virtually set and get values on the form::
443443

444-
// set values on the form internally
444+
// sets values on the form internally
445445
$form->setValues(array(
446446
'registration[username]' => 'symfonyfan',
447447
'registration[terms]' => 1,
448448
));
449449

450-
// get back an array of values - in the "flat" array like above
450+
// gets back an array of values - in the "flat" array like above
451451
$values = $form->getValues();
452452

453453
// returns the values like PHP would see them,
@@ -464,10 +464,10 @@ To work with multi-dimensional fields::
464464

465465
Pass an array of values::
466466

467-
// Set a single field
467+
// sets a single field
468468
$form->setValues(array('multi' => array('value')));
469469

470-
// Set multiple fields at once
470+
// sets multiple fields at once
471471
$form->setValues(array('multi' => array(
472472
1 => 'value',
473473
'dimensional' => 'an other value'
@@ -479,17 +479,17 @@ and uploading files::
479479

480480
$form['registration[username]']->setValue('symfonyfan');
481481

482-
// check or uncheck a checkbox
482+
// checks or unchecks a checkbox
483483
$form['registration[terms]']->tick();
484484
$form['registration[terms]']->untick();
485485

486-
// select an option
486+
// selects an option
487487
$form['registration[birthday][year]']->select(1984);
488488

489-
// select many options from a "multiple" select
489+
// selects many options from a "multiple" select
490490
$form['registration[interests]']->select(array('symfony', 'cookies'));
491491

492-
// even fake a file upload
492+
// fakes a file upload
493493
$form['registration[photo]']->upload('/path/to/lucas.jpg');
494494

495495
Using the Form Data
@@ -518,7 +518,7 @@ directly::
518518

519519
use Goutte\Client;
520520

521-
// make a real request to an external site
521+
// makes a real request to an external site
522522
$client = new Client();
523523
$crawler = $client->request('GET', 'https://github.com/login');
524524

@@ -527,7 +527,7 @@ directly::
527527
$form['login'] = 'symfonyfan';
528528
$form['password'] = 'anypass';
529529

530-
// submit that form
530+
// submits the given form
531531
$crawler = $client->submit($form);
532532

533533
.. _components-dom-crawler-invalid:
@@ -540,10 +540,10 @@ to prevent you from setting invalid values. If you want to be able to set
540540
invalid values, you can use the ``disableValidation()`` method on either
541541
the whole form or specific field(s)::
542542

543-
// Disable validation for a specific field
543+
// disables validation for a specific field
544544
$form['country']->disableValidation()->select('Invalid value');
545545

546-
// Disable validation for the whole form
546+
// disables validation for the whole form
547547
$form->disableValidation();
548548
$form['country']->select('Invalid value');
549549

components/event_dispatcher.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -207,14 +207,14 @@ determine which instance is passed.
207207

208208
$containerBuilder->register('event_dispatcher', EventDispatcher::class);
209209

210-
// register an event listener
210+
// registers an event listener
211211
$containerBuilder->register('listener_service_id', \AcmeListener::class)
212212
->addTag('kernel.event_listener', array(
213213
'event' => 'acme.foo.action',
214214
'method' => 'onFooAction',
215215
));
216216

217-
// register an event subscriber
217+
// registers an event subscriber
218218
$containerBuilder->register('subscriber_service_id', \AcmeSubscriber::class)
219219
->addTag('kernel.event_subscriber');
220220

@@ -299,7 +299,7 @@ each listener of that event::
299299
$order = new Order();
300300
// ...
301301

302-
// create the OrderPlacedEvent and dispatch it
302+
// creates the OrderPlacedEvent and dispatches it
303303
$event = new OrderPlacedEvent($order);
304304
$dispatcher->dispatch(OrderPlacedEvent::NAME, $event);
305305

components/event_dispatcher/traceable_dispatcher.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ to register event listeners and dispatch events::
2727

2828
// ...
2929

30-
// register an event listener
30+
// registers an event listener
3131
$eventListener = ...;
3232
$priority = ...;
3333
$traceableEventDispatcher->addListener(
@@ -36,7 +36,7 @@ to register event listeners and dispatch events::
3636
$priority
3737
);
3838

39-
// dispatch an event
39+
// dispatches an event
4040
$event = ...;
4141
$traceableEventDispatcher->dispatch('event.the_name', $event);
4242

components/expression_language/extending.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ or by using the second argument of the constructor::
132132
{
133133
public function __construct(ParserCacheInterface $parser = null, array $providers = array())
134134
{
135-
// prepend the default provider to let users override it easily
135+
// prepends the default provider to let users override it easily
136136
array_unshift($providers, new StringExpressionLanguageProvider());
137137

138138
parent::__construct($parser, $providers);

0 commit comments

Comments
 (0)