Skip to content

Commit 3a57b77

Browse files
committed
Merge branch '2.7' into 2.8
2 parents 92d9ba3 + 88d586b commit 3a57b77

File tree

7 files changed

+70
-28
lines changed

7 files changed

+70
-28
lines changed

src/Symfony/Bundle/FrameworkBundle/Client.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ protected function getScript($request)
185185
$code = <<<EOF
186186
<?php
187187
188-
error_reporting($errorReporting & ~E_USER_DEPRECATED);
188+
error_reporting($errorReporting);
189189
190190
if ('$autoloader') {
191191
require_once '$autoloader';

src/Symfony/Component/Console/Helper/SymfonyQuestionHelper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function ask(InputInterface $input, OutputInterface $output, Question $qu
3333
{
3434
$validator = $question->getValidator();
3535
$question->setValidator(function ($value) use ($validator) {
36-
if (null !== $validator && is_callable($validator)) {
36+
if (null !== $validator) {
3737
$value = $validator($value);
3838
}
3939

src/Symfony/Component/Console/Helper/Table.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ private function calculateNumberOfColumns()
384384
$columns[] = $this->getNumberOfColumns($row);
385385
}
386386

387-
return $this->numberOfColumns = max($columns);
387+
$this->numberOfColumns = max($columns);
388388
}
389389

390390
private function buildTableRows($rows)
@@ -539,7 +539,7 @@ private function getNumberOfColumns(array $row)
539539
*
540540
* @param array $row
541541
*
542-
* @return array()
542+
* @return array
543543
*/
544544
private function getRowColumns($row)
545545
{
@@ -578,8 +578,6 @@ private function calculateColumnsWidth($rows)
578578
/**
579579
* Gets column width.
580580
*
581-
* @param int $column
582-
*
583581
* @return int
584582
*/
585583
private function getColumnSeparatorWidth()

src/Symfony/Component/Form/Tests/Extension/Csrf/CsrfProvider/LegacyDefaultCsrfProviderTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ public static function setUpBeforeClass()
2626
{
2727
ini_set('session.save_handler', 'files');
2828
ini_set('session.save_path', sys_get_temp_dir());
29-
ini_set('error_reporting', -1 & ~E_USER_DEPRECATED);
3029
}
3130

3231
protected function setUp()

src/Symfony/Component/HttpKernel/Client.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ protected function getScript($request)
105105
$code = <<<EOF
106106
<?php
107107
108-
error_reporting($errorReporting & ~E_USER_DEPRECATED);
108+
error_reporting($errorReporting);
109109
110110
require_once '$requirePath';
111111

src/Symfony/Component/PropertyAccess/PropertyAccessor.php

Lines changed: 64 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,74 @@
2424
*/
2525
class PropertyAccessor implements PropertyAccessorInterface
2626
{
27+
/**
28+
* @internal
29+
*/
2730
const VALUE = 0;
31+
32+
/**
33+
* @internal
34+
*/
2835
const IS_REF = 1;
36+
37+
/**
38+
* @internal
39+
*/
2940
const IS_REF_CHAINED = 2;
41+
42+
/**
43+
* @internal
44+
*/
3045
const ACCESS_HAS_PROPERTY = 0;
46+
47+
/**
48+
* @internal
49+
*/
3150
const ACCESS_TYPE = 1;
51+
52+
/**
53+
* @internal
54+
*/
3255
const ACCESS_NAME = 2;
56+
57+
/**
58+
* @internal
59+
*/
3360
const ACCESS_REF = 3;
61+
62+
/**
63+
* @internal
64+
*/
3465
const ACCESS_ADDER = 4;
66+
67+
/**
68+
* @internal
69+
*/
3570
const ACCESS_REMOVER = 5;
71+
72+
/**
73+
* @internal
74+
*/
3675
const ACCESS_TYPE_METHOD = 0;
76+
77+
/**
78+
* @internal
79+
*/
3780
const ACCESS_TYPE_PROPERTY = 1;
81+
82+
/**
83+
* @internal
84+
*/
3885
const ACCESS_TYPE_MAGIC = 2;
86+
87+
/**
88+
* @internal
89+
*/
3990
const ACCESS_TYPE_ADDER_AND_REMOVER = 3;
91+
92+
/**
93+
* @internal
94+
*/
4095
const ACCESS_TYPE_NOT_FOUND = 4;
4196

4297
/**
@@ -62,6 +117,9 @@ class PropertyAccessor implements PropertyAccessorInterface
62117
/**
63118
* Should not be used by application code. Use
64119
* {@link PropertyAccess::createPropertyAccessor()} instead.
120+
*
121+
* @param bool $magicCall
122+
* @param bool $throwExceptionOnInvalidIndex
65123
*/
66124
public function __construct($magicCall = false, $throwExceptionOnInvalidIndex = false)
67125
{
@@ -365,7 +423,7 @@ private function &readProperty(&$object, $property)
365423
}
366424
} elseif (!$access[self::ACCESS_HAS_PROPERTY] && property_exists($object, $property)) {
367425
// Needed to support \stdClass instances. We need to explicitly
368-
// exclude $classHasProperty, otherwise if in the previous clause
426+
// exclude $access[self::ACCESS_HAS_PROPERTY], otherwise if
369427
// a *protected* property was found on the class, property_exists()
370428
// returns true, consequently the following line will result in a
371429
// fatal error.
@@ -411,7 +469,6 @@ private function getReadAccessInfo($object, $property)
411469
$getsetter = lcfirst($camelProp); // jQuery style, e.g. read: last(), write: last($item)
412470
$isser = 'is'.$camelProp;
413471
$hasser = 'has'.$camelProp;
414-
$classHasProperty = $reflClass->hasProperty($property);
415472

416473
if ($reflClass->hasMethod($getter) && $reflClass->getMethod($getter)->isPublic()) {
417474
$access[self::ACCESS_TYPE] = self::ACCESS_TYPE_METHOD;
@@ -429,13 +486,10 @@ private function getReadAccessInfo($object, $property)
429486
$access[self::ACCESS_TYPE] = self::ACCESS_TYPE_PROPERTY;
430487
$access[self::ACCESS_NAME] = $property;
431488
$access[self::ACCESS_REF] = false;
432-
} elseif ($classHasProperty && $reflClass->getProperty($property)->isPublic()) {
489+
} elseif ($access[self::ACCESS_HAS_PROPERTY] && $reflClass->getProperty($property)->isPublic()) {
433490
$access[self::ACCESS_TYPE] = self::ACCESS_TYPE_PROPERTY;
434491
$access[self::ACCESS_NAME] = $property;
435492
$access[self::ACCESS_REF] = true;
436-
437-
$result[self::VALUE] = &$object->$property;
438-
$result[self::IS_REF] = true;
439493
} elseif ($this->magicCall && $reflClass->hasMethod('__call') && $reflClass->getMethod('__call')->isPublic()) {
440494
// we call the getter and hope the __call do the job
441495
$access[self::ACCESS_TYPE] = self::ACCESS_TYPE_MAGIC;
@@ -506,7 +560,7 @@ private function writeProperty(&$object, $property, $value)
506560
$this->writeCollection($object, $property, $value, $access[self::ACCESS_ADDER], $access[self::ACCESS_REMOVER]);
507561
} elseif (!$access[self::ACCESS_HAS_PROPERTY] && property_exists($object, $property)) {
508562
// Needed to support \stdClass instances. We need to explicitly
509-
// exclude $classHasProperty, otherwise if in the previous clause
563+
// exclude $access[self::ACCESS_HAS_PROPERTY], otherwise if
510564
// a *protected* property was found on the class, property_exists()
511565
// returns true, consequently the following line will result in a
512566
// fatal error.
@@ -579,7 +633,6 @@ private function writeCollection($object, $property, $collection, $addMethod, $r
579633
private function getWriteAccessInfo($object, $property, $value)
580634
{
581635
$key = get_class($object).'::'.$property;
582-
$guessedAdders = '';
583636

584637
if (isset($this->writePropertyCache[$key])) {
585638
$access = $this->writePropertyCache[$key];
@@ -594,25 +647,17 @@ private function getWriteAccessInfo($object, $property, $value)
594647
if (is_array($value) || $value instanceof \Traversable) {
595648
$methods = $this->findAdderAndRemover($reflClass, $singulars);
596649

597-
if (null === $methods) {
598-
// It is sufficient to include only the adders in the error
599-
// message. If the user implements the adder but not the remover,
600-
// an exception will be thrown in findAdderAndRemover() that
601-
// the remover has to be implemented as well.
602-
$guessedAdders = '"add'.implode('()", "add', $singulars).'()", ';
603-
} else {
650+
if (null !== $methods) {
604651
$access[self::ACCESS_TYPE] = self::ACCESS_TYPE_ADDER_AND_REMOVER;
605652
$access[self::ACCESS_ADDER] = $methods[0];
606653
$access[self::ACCESS_REMOVER] = $methods[1];
607654
}
608655
}
609656

610657
if (!isset($access[self::ACCESS_TYPE])) {
611-
$setter = 'set'.$this->camelize($property);
658+
$setter = 'set'.$camelized;
612659
$getsetter = lcfirst($camelized); // jQuery style, e.g. read: last(), write: last($item)
613660

614-
$classHasProperty = $reflClass->hasProperty($property);
615-
616661
if ($this->isMethodAccessible($reflClass, $setter, 1)) {
617662
$access[self::ACCESS_TYPE] = self::ACCESS_TYPE_METHOD;
618663
$access[self::ACCESS_NAME] = $setter;
@@ -622,7 +667,7 @@ private function getWriteAccessInfo($object, $property, $value)
622667
} elseif ($this->isMethodAccessible($reflClass, '__set', 2)) {
623668
$access[self::ACCESS_TYPE] = self::ACCESS_TYPE_PROPERTY;
624669
$access[self::ACCESS_NAME] = $property;
625-
} elseif ($classHasProperty && $reflClass->getProperty($property)->isPublic()) {
670+
} elseif ($access[self::ACCESS_HAS_PROPERTY] && $reflClass->getProperty($property)->isPublic()) {
626671
$access[self::ACCESS_TYPE] = self::ACCESS_TYPE_PROPERTY;
627672
$access[self::ACCESS_NAME] = $property;
628673
} elseif ($this->magicCall && $this->isMethodAccessible($reflClass, '__call', 2)) {

src/Symfony/Component/Security/Http/EntryPoint/AuthenticationEntryPointInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ interface AuthenticationEntryPointInterface
3232
*
3333
* Examples:
3434
* A) For a form login, you might redirect to the login page
35-
* return new Response('/login');
35+
* return new RedirectResponse('/login');
3636
* B) For an API token authentication system, you return a 401 response
3737
* return new Response('Auth header required', 401);
3838
*

0 commit comments

Comments
 (0)