diff --git a/src/Symfony/Bundle/FrameworkBundle/Client.php b/src/Symfony/Bundle/FrameworkBundle/Client.php index 82e627a726..d9b064e5ec 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Client.php +++ b/src/Symfony/Bundle/FrameworkBundle/Client.php @@ -185,7 +185,7 @@ class Client extends BaseClient $code = <<getValidator(); $question->setValidator(function ($value) use ($validator) { - if (null !== $validator && is_callable($validator)) { + if (null !== $validator) { $value = $validator($value); } diff --git a/src/Symfony/Component/Console/Helper/Table.php b/src/Symfony/Component/Console/Helper/Table.php index 243c6a8880..8cc6d56e5d 100644 --- a/src/Symfony/Component/Console/Helper/Table.php +++ b/src/Symfony/Component/Console/Helper/Table.php @@ -384,7 +384,7 @@ class Table $columns[] = $this->getNumberOfColumns($row); } - return $this->numberOfColumns = max($columns); + $this->numberOfColumns = max($columns); } private function buildTableRows($rows) @@ -539,7 +539,7 @@ class Table * * @param array $row * - * @return array() + * @return array */ private function getRowColumns($row) { @@ -578,8 +578,6 @@ class Table /** * Gets column width. * - * @param int $column - * * @return int */ private function getColumnSeparatorWidth() diff --git a/src/Symfony/Component/Form/Tests/Extension/Csrf/CsrfProvider/LegacyDefaultCsrfProviderTest.php b/src/Symfony/Component/Form/Tests/Extension/Csrf/CsrfProvider/LegacyDefaultCsrfProviderTest.php index 629d8e4f32..29e370df09 100644 --- a/src/Symfony/Component/Form/Tests/Extension/Csrf/CsrfProvider/LegacyDefaultCsrfProviderTest.php +++ b/src/Symfony/Component/Form/Tests/Extension/Csrf/CsrfProvider/LegacyDefaultCsrfProviderTest.php @@ -26,7 +26,6 @@ class LegacyDefaultCsrfProviderTest extends \PHPUnit_Framework_TestCase { ini_set('session.save_handler', 'files'); ini_set('session.save_path', sys_get_temp_dir()); - ini_set('error_reporting', -1 & ~E_USER_DEPRECATED); } protected function setUp() diff --git a/src/Symfony/Component/HttpKernel/Client.php b/src/Symfony/Component/HttpKernel/Client.php index b344fa151a..80b1bd6cd3 100644 --- a/src/Symfony/Component/HttpKernel/Client.php +++ b/src/Symfony/Component/HttpKernel/Client.php @@ -105,7 +105,7 @@ class Client extends BaseClient $code = <<hasProperty($property); if ($reflClass->hasMethod($getter) && $reflClass->getMethod($getter)->isPublic()) { $access[self::ACCESS_TYPE] = self::ACCESS_TYPE_METHOD; @@ -429,13 +486,10 @@ class PropertyAccessor implements PropertyAccessorInterface $access[self::ACCESS_TYPE] = self::ACCESS_TYPE_PROPERTY; $access[self::ACCESS_NAME] = $property; $access[self::ACCESS_REF] = false; - } elseif ($classHasProperty && $reflClass->getProperty($property)->isPublic()) { + } elseif ($access[self::ACCESS_HAS_PROPERTY] && $reflClass->getProperty($property)->isPublic()) { $access[self::ACCESS_TYPE] = self::ACCESS_TYPE_PROPERTY; $access[self::ACCESS_NAME] = $property; $access[self::ACCESS_REF] = true; - - $result[self::VALUE] = &$object->$property; - $result[self::IS_REF] = true; } elseif ($this->magicCall && $reflClass->hasMethod('__call') && $reflClass->getMethod('__call')->isPublic()) { // we call the getter and hope the __call do the job $access[self::ACCESS_TYPE] = self::ACCESS_TYPE_MAGIC; @@ -506,7 +560,7 @@ class PropertyAccessor implements PropertyAccessorInterface $this->writeCollection($object, $property, $value, $access[self::ACCESS_ADDER], $access[self::ACCESS_REMOVER]); } elseif (!$access[self::ACCESS_HAS_PROPERTY] && property_exists($object, $property)) { // Needed to support \stdClass instances. We need to explicitly - // exclude $classHasProperty, otherwise if in the previous clause + // exclude $access[self::ACCESS_HAS_PROPERTY], otherwise if // a *protected* property was found on the class, property_exists() // returns true, consequently the following line will result in a // fatal error. @@ -579,7 +633,6 @@ class PropertyAccessor implements PropertyAccessorInterface private function getWriteAccessInfo($object, $property, $value) { $key = get_class($object).'::'.$property; - $guessedAdders = ''; if (isset($this->writePropertyCache[$key])) { $access = $this->writePropertyCache[$key]; @@ -594,13 +647,7 @@ class PropertyAccessor implements PropertyAccessorInterface if (is_array($value) || $value instanceof \Traversable) { $methods = $this->findAdderAndRemover($reflClass, $singulars); - if (null === $methods) { - // It is sufficient to include only the adders in the error - // message. If the user implements the adder but not the remover, - // an exception will be thrown in findAdderAndRemover() that - // the remover has to be implemented as well. - $guessedAdders = '"add'.implode('()", "add', $singulars).'()", '; - } else { + if (null !== $methods) { $access[self::ACCESS_TYPE] = self::ACCESS_TYPE_ADDER_AND_REMOVER; $access[self::ACCESS_ADDER] = $methods[0]; $access[self::ACCESS_REMOVER] = $methods[1]; @@ -608,11 +655,9 @@ class PropertyAccessor implements PropertyAccessorInterface } if (!isset($access[self::ACCESS_TYPE])) { - $setter = 'set'.$this->camelize($property); + $setter = 'set'.$camelized; $getsetter = lcfirst($camelized); // jQuery style, e.g. read: last(), write: last($item) - $classHasProperty = $reflClass->hasProperty($property); - if ($this->isMethodAccessible($reflClass, $setter, 1)) { $access[self::ACCESS_TYPE] = self::ACCESS_TYPE_METHOD; $access[self::ACCESS_NAME] = $setter; @@ -622,7 +667,7 @@ class PropertyAccessor implements PropertyAccessorInterface } elseif ($this->isMethodAccessible($reflClass, '__set', 2)) { $access[self::ACCESS_TYPE] = self::ACCESS_TYPE_PROPERTY; $access[self::ACCESS_NAME] = $property; - } elseif ($classHasProperty && $reflClass->getProperty($property)->isPublic()) { + } elseif ($access[self::ACCESS_HAS_PROPERTY] && $reflClass->getProperty($property)->isPublic()) { $access[self::ACCESS_TYPE] = self::ACCESS_TYPE_PROPERTY; $access[self::ACCESS_NAME] = $property; } elseif ($this->magicCall && $this->isMethodAccessible($reflClass, '__call', 2)) { diff --git a/src/Symfony/Component/Security/Http/EntryPoint/AuthenticationEntryPointInterface.php b/src/Symfony/Component/Security/Http/EntryPoint/AuthenticationEntryPointInterface.php index df777f688c..9bade0cb69 100644 --- a/src/Symfony/Component/Security/Http/EntryPoint/AuthenticationEntryPointInterface.php +++ b/src/Symfony/Component/Security/Http/EntryPoint/AuthenticationEntryPointInterface.php @@ -32,7 +32,7 @@ interface AuthenticationEntryPointInterface * * Examples: * A) For a form login, you might redirect to the login page - * return new Response('/login'); + * return new RedirectResponse('/login'); * B) For an API token authentication system, you return a 401 response * return new Response('Auth header required', 401); *