Skip to content

Commit ab17874

Browse files
committed
Merge branch '2.7' into 2.8
* 2.7: 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 b01d242 + e345096 commit ab17874

Some content is hidden

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

54 files changed

+294
-257
lines changed

components/asset.rst

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

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

120120
echo $package->getUrl('/image.png');
121121
// result: /image.png?version=v1
122122

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

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

components/class_loader/cache_class_loader.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ ApcClassLoader
3434
// sha1(__FILE__) generates an APC namespace prefix
3535
$cachedLoader = new ApcClassLoader(sha1(__FILE__), $loader);
3636

37-
// register the cached class loader
37+
// registers the cached class loader
3838
$cachedLoader->register();
3939

40-
// deactivate the original, non-cached loader if it was registered previously
40+
// deactivates the original, non-cached loader if it was registered previously
4141
$loader->unregister();
4242

4343
XcacheClassLoader
@@ -54,10 +54,10 @@ it is straightforward::
5454
// sha1(__FILE__) generates an XCache namespace prefix
5555
$cachedLoader = new XcacheClassLoader(sha1(__FILE__), $loader);
5656

57-
// register the cached class loader
57+
// registers the cached class loader
5858
$cachedLoader->register();
5959

60-
// deactivate the original, non-cached loader if it was registered previously
60+
// deactivates the original, non-cached loader if it was registered previously
6161
$loader->unregister();
6262

6363
.. _APC: http://php.net/manual/en/book.apc.php

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
@@ -40,19 +40,19 @@ dispatched. Listeners receive a
4040
use Symfony\Component\Console\ConsoleEvents;
4141

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

46-
// get the output instance
46+
// gets the output instance
4747
$output = $event->getOutput();
4848

49-
// get the command to be executed
49+
// gets the command to be executed
5050
$command = $event->getCommand();
5151

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

55-
// get the application
55+
// gets the application
5656
$application = $command->getApplication();
5757
});
5858

@@ -71,12 +71,12 @@ C/C++ standard.::
7171
use Symfony\Component\Console\ConsoleEvents;
7272

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

7777
// ... check if the command can be executed
7878

79-
// disable the command, this will result in the command being skipped
79+
// disables the command, this will result in the command being skipped
8080
// and code 113 being returned from the Application
8181
$event->disableCommand();
8282

@@ -109,10 +109,10 @@ Listeners receive a
109109

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

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

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

@@ -135,16 +135,16 @@ Listeners receive a
135135
use Symfony\Component\Console\ConsoleEvents;
136136

137137
$dispatcher->addListener(ConsoleEvents::TERMINATE, function (ConsoleTerminateEvent $event) {
138-
// get the output
138+
// gets the output
139139
$output = $event->getOutput();
140140

141-
// get the command that has been executed
141+
// gets the command that has been executed
142142
$command = $event->getCommand();
143143

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

147-
// change the exit code
147+
// changes the exit code
148148
$event->setExitCode(128);
149149
});
150150

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
Instead of advancing the bar by a number of steps (with the

components/console/helpers/table.rst

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

114-
// customize the style
114+
// customizes the style
115115
$style
116116
->setHorizontalBorderChar('<fg=magenta>|</>')
117117
->setVerticalBorderChar('<fg=magenta>-</>')
118118
->setCrossingChar(' ')
119119
;
120120

121-
// use the style for this table
121+
// uses the custom style for this table
122122
$table->setStyle($style);
123123

124124
Here is a full list of things you can customize:
@@ -136,10 +136,10 @@ Here is a full list of things you can customize:
136136

137137
You can also register a style globally::
138138

139-
// register the style under the colorful name
139+
// registers the style under the colorful name
140140
Table::setStyleDefinition('colorful', $style);
141141

142-
// use it for a table
142+
// applies the custom style for the given table
143143
$table->setStyle('colorful');
144144

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

components/console/single_command_tool.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ it is possible to remove this need by extending the application::
3535
*/
3636
protected function getDefaultCommands()
3737
{
38-
// Keep the core default commands to have the HelpCommand
38+
// Keeps the core default commands to have the HelpCommand
3939
// which is used when using the --help option
4040
$defaultCommands = parent::getDefaultCommands();
4141

@@ -51,7 +51,7 @@ it is possible to remove this need by extending the application::
5151
public function getDefinition()
5252
{
5353
$inputDefinition = parent::getDefinition();
54-
// clear out the normal first argument, which is the command name
54+
// clears out the normal first argument, which is the command name
5555
$inputDefinition->setArguments();
5656

5757
return $inputDefinition;

components/dom_crawler.rst

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

@@ -183,7 +183,7 @@ Accessing Node Values
183183

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

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

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

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

310310
.. note::
@@ -355,13 +355,13 @@ attribute followed by a query string of all of the form's values.
355355

356356
You can virtually set and get values on the form::
357357

358-
// set values on the form internally
358+
// sets values on the form internally
359359
$form->setValues(array(
360360
'registration[username]' => 'symfonyfan',
361361
'registration[terms]' => 1,
362362
));
363363

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

367367
// returns the values like PHP would see them,
@@ -378,10 +378,10 @@ To work with multi-dimensional fields::
378378

379379
Pass an array of values::
380380

381-
// Set a single field
381+
// sets a single field
382382
$form->setValues(array('multi' => array('value')));
383383

384-
// Set multiple fields at once
384+
// sets multiple fields at once
385385
$form->setValues(array('multi' => array(
386386
1 => 'value',
387387
'dimensional' => 'an other value'
@@ -393,17 +393,17 @@ and uploading files::
393393

394394
$form['registration[username]']->setValue('symfonyfan');
395395

396-
// check or uncheck a checkbox
396+
// checks or unchecks a checkbox
397397
$form['registration[terms]']->tick();
398398
$form['registration[terms]']->untick();
399399

400-
// select an option
400+
// selects an option
401401
$form['registration[birthday][year]']->select(1984);
402402

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

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

409409
Using the Form Data
@@ -432,7 +432,7 @@ directly::
432432

433433
use Goutte\Client;
434434

435-
// make a real request to an external site
435+
// makes a real request to an external site
436436
$client = new Client();
437437
$crawler = $client->request('GET', 'https://github.com/login');
438438

@@ -441,7 +441,7 @@ directly::
441441
$form['login'] = 'symfonyfan';
442442
$form['password'] = 'anypass';
443443

444-
// submit that form
444+
// submits the given form
445445
$crawler = $client->submit($form);
446446

447447
.. _components-dom-crawler-invalid:
@@ -454,10 +454,10 @@ to prevent you from setting invalid values. If you want to be able to set
454454
invalid values, you can use the ``disableValidation()`` method on either
455455
the whole form or specific field(s)::
456456

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

460-
// Disable validation for the whole form
460+
// disables validation for the whole form
461461
$form->disableValidation();
462462
$form['country']->select('Invalid value');
463463

components/event_dispatcher.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -206,18 +206,18 @@ determine which instance is passed.
206206
$containerBuilder = new ContainerBuilder(new ParameterBag());
207207
$containerBuilder->addCompilerPass(new RegisterListenersPass());
208208

209-
// register the event dispatcher service
209+
// registers the event dispatcher service
210210
$containerBuilder->register('event_dispatcher', ContainerAwareEventDispatcher::class)
211211
->addArgument(new Reference('service_container'));
212212

213-
// register your event listener service
213+
// registers your event listener service
214214
$containerBuilder->register('listener_service_id', \AcmeListener::class)
215215
->addTag('kernel.event_listener', array(
216216
'event' => 'acme.foo.action',
217217
'method' => 'onFooAction',
218218
));
219219

220-
// register an event subscriber
220+
// registers an event subscriber
221221
$containerBuilder->register('subscriber_service_id', \AcmeSubscriber::class)
222222
->addTag('kernel.event_subscriber');
223223

@@ -302,7 +302,7 @@ each listener of that event::
302302
$order = new Order();
303303
// ...
304304

305-
// create the OrderPlacedEvent and dispatch it
305+
// creates the OrderPlacedEvent and dispatches it
306306
$event = new OrderPlacedEvent($order);
307307
$dispatcher->dispatch(OrderPlacedEvent::NAME, $event);
308308

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
@@ -117,7 +117,7 @@ or by using the second argument of the constructor::
117117
{
118118
public function __construct(ParserCacheInterface $parser = null, array $providers = array())
119119
{
120-
// prepend the default provider to let users override it easily
120+
// prepends the default provider to let users override it easily
121121
array_unshift($providers, new StringExpressionLanguageProvider());
122122

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

0 commit comments

Comments
 (0)