Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 58f8f51

Browse filesBrowse files
committed
Merge branch '2.3' into 2.7
* 2.3: Update HTTP statuses list [Console][#18619] Prevent fatal error when calling Command#getHelper() without helperSet Add SplFileInfo array doc on Finder iterator methods so that IDE will know what it returns [2.3] [Form] Modified iterator_to_array's 2nd parameter to false in ViolationMapper Updated the link to the list of currency codes
2 parents 8648fe2 + c02eee0 commit 58f8f51
Copy full SHA for 58f8f51

File tree

Expand file treeCollapse file tree

6 files changed

+46
-32
lines changed
Filter options
Expand file treeCollapse file tree

6 files changed

+46
-32
lines changed

‎src/Symfony/Component/Console/Command/Command.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Console/Command/Command.php
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -598,10 +598,15 @@ public function getUsages()
598598
*
599599
* @return mixed The helper value
600600
*
601+
* @throws \LogicException if no HelperSet is defined
601602
* @throws \InvalidArgumentException if the helper is not defined
602603
*/
603604
public function getHelper($name)
604605
{
606+
if (null === $this->helperSet) {
607+
throw new \LogicException(sprintf('Cannot retrieve helper "%s" because there is no HelperSet defined. Did you forget to add your command to the application or to set the application on the command using the setApplication() method? You can also set the HelperSet directly using the setHelperSet() method.', $name));
608+
}
609+
605610
return $this->helperSet->get($name);
606611
}
607612

‎src/Symfony/Component/Console/Tests/Command/CommandTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Console/Tests/Command/CommandTest.php
+10Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,16 @@ public function testGetHelper()
173173
$this->assertEquals($formatterHelper->getName(), $command->getHelper('formatter')->getName(), '->getHelper() returns the correct helper');
174174
}
175175

176+
/**
177+
* @expectedException \LogicException
178+
* @expectedExceptionMessage Cannot retrieve helper "formatter" because there is no HelperSet defined.
179+
*/
180+
public function testGetHelperWithoutHelperSet()
181+
{
182+
$command = new \TestCommand();
183+
$command->getHelper('formatter');
184+
}
185+
176186
public function testMergeApplicationDefinition()
177187
{
178188
$application1 = new Application();

‎src/Symfony/Component/Finder/Finder.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Finder/Finder.php
+25-25Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ public function getAdapters()
171171
/**
172172
* Restricts the matching to directories only.
173173
*
174-
* @return Finder The current Finder instance
174+
* @return Finder|SplFileInfo[] The current Finder instance
175175
*/
176176
public function directories()
177177
{
@@ -183,7 +183,7 @@ public function directories()
183183
/**
184184
* Restricts the matching to files only.
185185
*
186-
* @return Finder The current Finder instance
186+
* @return Finder|SplFileInfo[] The current Finder instance
187187
*/
188188
public function files()
189189
{
@@ -202,7 +202,7 @@ public function files()
202202
*
203203
* @param int $level The depth level expression
204204
*
205-
* @return Finder The current Finder instance
205+
* @return Finder|SplFileInfo[] The current Finder instance
206206
*
207207
* @see DepthRangeFilterIterator
208208
* @see NumberComparator
@@ -226,7 +226,7 @@ public function depth($level)
226226
*
227227
* @param string $date A date range string
228228
*
229-
* @return Finder The current Finder instance
229+
* @return Finder|SplFileInfo[] The current Finder instance
230230
*
231231
* @see strtotime
232232
* @see DateRangeFilterIterator
@@ -250,7 +250,7 @@ public function date($date)
250250
*
251251
* @param string $pattern A pattern (a regexp, a glob, or a string)
252252
*
253-
* @return Finder The current Finder instance
253+
* @return Finder|SplFileInfo[] The current Finder instance
254254
*
255255
* @see FilenameFilterIterator
256256
*/
@@ -266,7 +266,7 @@ public function name($pattern)
266266
*
267267
* @param string $pattern A pattern (a regexp, a glob, or a string)
268268
*
269-
* @return Finder The current Finder instance
269+
* @return Finder|SplFileInfo[] The current Finder instance
270270
*
271271
* @see FilenameFilterIterator
272272
*/
@@ -287,7 +287,7 @@ public function notName($pattern)
287287
*
288288
* @param string $pattern A pattern (string or regexp)
289289
*
290-
* @return Finder The current Finder instance
290+
* @return Finder|SplFileInfo[] The current Finder instance
291291
*
292292
* @see FilecontentFilterIterator
293293
*/
@@ -308,7 +308,7 @@ public function contains($pattern)
308308
*
309309
* @param string $pattern A pattern (string or regexp)
310310
*
311-
* @return Finder The current Finder instance
311+
* @return Finder|SplFileInfo[] The current Finder instance
312312
*
313313
* @see FilecontentFilterIterator
314314
*/
@@ -331,7 +331,7 @@ public function notContains($pattern)
331331
*
332332
* @param string $pattern A pattern (a regexp or a string)
333333
*
334-
* @return Finder The current Finder instance
334+
* @return Finder|SplFileInfo[] The current Finder instance
335335
*
336336
* @see FilenameFilterIterator
337337
*/
@@ -354,7 +354,7 @@ public function path($pattern)
354354
*
355355
* @param string $pattern A pattern (a regexp or a string)
356356
*
357-
* @return Finder The current Finder instance
357+
* @return Finder|SplFileInfo[] The current Finder instance
358358
*
359359
* @see FilenameFilterIterator
360360
*/
@@ -374,7 +374,7 @@ public function notPath($pattern)
374374
*
375375
* @param string $size A size range string
376376
*
377-
* @return Finder The current Finder instance
377+
* @return Finder|SplFileInfo[] The current Finder instance
378378
*
379379
* @see SizeRangeFilterIterator
380380
* @see NumberComparator
@@ -391,7 +391,7 @@ public function size($size)
391391
*
392392
* @param string|array $dirs A directory path or an array of directories
393393
*
394-
* @return Finder The current Finder instance
394+
* @return Finder|SplFileInfo[] The current Finder instance
395395
*
396396
* @see ExcludeDirectoryFilterIterator
397397
*/
@@ -407,7 +407,7 @@ public function exclude($dirs)
407407
*
408408
* @param bool $ignoreDotFiles Whether to exclude "hidden" files or not
409409
*
410-
* @return Finder The current Finder instance
410+
* @return Finder|SplFileInfo[] The current Finder instance
411411
*
412412
* @see ExcludeDirectoryFilterIterator
413413
*/
@@ -427,7 +427,7 @@ public function ignoreDotFiles($ignoreDotFiles)
427427
*
428428
* @param bool $ignoreVCS Whether to exclude VCS files or not
429429
*
430-
* @return Finder The current Finder instance
430+
* @return Finder|SplFileInfo[] The current Finder instance
431431
*
432432
* @see ExcludeDirectoryFilterIterator
433433
*/
@@ -467,7 +467,7 @@ public static function addVCSPattern($pattern)
467467
*
468468
* @param \Closure $closure An anonymous function
469469
*
470-
* @return Finder The current Finder instance
470+
* @return Finder|SplFileInfo[] The current Finder instance
471471
*
472472
* @see SortableIterator
473473
*/
@@ -483,7 +483,7 @@ public function sort(\Closure $closure)
483483
*
484484
* This can be slow as all the matching files and directories must be retrieved for comparison.
485485
*
486-
* @return Finder The current Finder instance
486+
* @return Finder|SplFileInfo[] The current Finder instance
487487
*
488488
* @see SortableIterator
489489
*/
@@ -499,7 +499,7 @@ public function sortByName()
499499
*
500500
* This can be slow as all the matching files and directories must be retrieved for comparison.
501501
*
502-
* @return Finder The current Finder instance
502+
* @return Finder|SplFileInfo[] The current Finder instance
503503
*
504504
* @see SortableIterator
505505
*/
@@ -517,7 +517,7 @@ public function sortByType()
517517
*
518518
* This can be slow as all the matching files and directories must be retrieved for comparison.
519519
*
520-
* @return Finder The current Finder instance
520+
* @return Finder|SplFileInfo[] The current Finder instance
521521
*
522522
* @see SortableIterator
523523
*/
@@ -537,7 +537,7 @@ public function sortByAccessedTime()
537537
*
538538
* This can be slow as all the matching files and directories must be retrieved for comparison.
539539
*
540-
* @return Finder The current Finder instance
540+
* @return Finder|SplFileInfo[] The current Finder instance
541541
*
542542
* @see SortableIterator
543543
*/
@@ -555,7 +555,7 @@ public function sortByChangedTime()
555555
*
556556
* This can be slow as all the matching files and directories must be retrieved for comparison.
557557
*
558-
* @return Finder The current Finder instance
558+
* @return Finder|SplFileInfo[] The current Finder instance
559559
*
560560
* @see SortableIterator
561561
*/
@@ -574,7 +574,7 @@ public function sortByModifiedTime()
574574
*
575575
* @param \Closure $closure An anonymous function
576576
*
577-
* @return Finder The current Finder instance
577+
* @return Finder|SplFileInfo[] The current Finder instance
578578
*
579579
* @see CustomFilterIterator
580580
*/
@@ -588,7 +588,7 @@ public function filter(\Closure $closure)
588588
/**
589589
* Forces the following of symlinks.
590590
*
591-
* @return Finder The current Finder instance
591+
* @return Finder|SplFileInfo[] The current Finder instance
592592
*/
593593
public function followLinks()
594594
{
@@ -604,7 +604,7 @@ public function followLinks()
604604
*
605605
* @param bool $ignore
606606
*
607-
* @return Finder The current Finder instance
607+
* @return Finder|SplFileInfo[] The current Finder instance
608608
*/
609609
public function ignoreUnreadableDirs($ignore = true)
610610
{
@@ -618,7 +618,7 @@ public function ignoreUnreadableDirs($ignore = true)
618618
*
619619
* @param string|array $dirs A directory path or an array of directories
620620
*
621-
* @return Finder The current Finder instance
621+
* @return Finder|SplFileInfo[] The current Finder instance
622622
*
623623
* @throws \InvalidArgumentException if one of the directories does not exist
624624
*/
@@ -679,7 +679,7 @@ public function getIterator()
679679
*
680680
* @param mixed $iterator
681681
*
682-
* @return Finder The finder
682+
* @return Finder|SplFileInfo[] The finder
683683
*
684684
* @throws \InvalidArgumentException When the given argument is not iterable.
685685
*/

‎src/Symfony/Component/Form/Extension/Validator/ViolationMapper/ViolationMapper.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Form/Extension/Validator/ViolationMapper/ViolationMapper.php
+3-5Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -162,9 +162,7 @@ private function matchChild(FormInterface $form, PropertyPathIteratorInterface $
162162
}
163163
}
164164

165-
$children = iterator_to_array(new \RecursiveIteratorIterator(
166-
new InheritDataAwareIterator($form)
167-
));
165+
$children = iterator_to_array(new \RecursiveIteratorIterator(new InheritDataAwareIterator($form)), false);
168166

169167
while ($it->valid()) {
170168
if ($it->isIndex()) {
@@ -189,7 +187,7 @@ private function matchChild(FormInterface $form, PropertyPathIteratorInterface $
189187
}
190188

191189
/** @var FormInterface $child */
192-
foreach ($children as $key => $child) {
190+
foreach ($children as $i => $child) {
193191
$childPath = (string) $child->getPropertyPath();
194192
if ($childPath === $chunk) {
195193
$target = $child;
@@ -198,7 +196,7 @@ private function matchChild(FormInterface $form, PropertyPathIteratorInterface $
198196
continue;
199197
}
200198

201-
unset($children[$key]);
199+
unset($children[$i]);
202200
}
203201

204202
$it->next();

‎src/Symfony/Component/HttpFoundation/Response.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpFoundation/Response.php
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ class Response
115115
*
116116
* The list of codes is complete according to the
117117
* {@link http://www.iana.org/assignments/http-status-codes/ Hypertext Transfer Protocol (HTTP) Status Code Registry}
118-
* (last updated 2012-02-13).
118+
* (last updated 2016-03-01).
119119
*
120120
* Unless otherwise noted, the status code is defined in RFC2616.
121121
*
@@ -163,6 +163,7 @@ class Response
163163
416 => 'Requested Range Not Satisfiable',
164164
417 => 'Expectation Failed',
165165
418 => 'I\'m a teapot', // RFC2324
166+
421 => 'Misdirected Request', // RFC7540
166167
422 => 'Unprocessable Entity', // RFC4918
167168
423 => 'Locked', // RFC4918
168169
424 => 'Failed Dependency', // RFC4918

‎src/Symfony/Component/Intl/NumberFormatter/NumberFormatter.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Intl/NumberFormatter/NumberFormatter.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ public static function create($locale = 'en', $style = null, $pattern = null)
326326
* @return string The formatted currency value
327327
*
328328
* @see http://www.php.net/manual/en/numberformatter.formatcurrency.php
329-
* @see http://www.iso.org/iso/support/faqs/faqs_widely_used_standards/widely_used_standards_other/currency_codes/currency_codes_list-1.htm
329+
* @see https://en.wikipedia.org/wiki/ISO_4217#Active_codes
330330
*/
331331
public function formatCurrency($value, $currency)
332332
{

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.