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 81c054a

Browse filesBrowse files
Merge branch '2.6' into 2.7
* 2.6: [travis] Use container-based infrastructure [PropertyAccess] Fix setting public property on a class having a magic getter ContainerInterface: unused exception dropped Conflicts: .travis.yml
2 parents 7ec5b4f + 52ba805 commit 81c054a
Copy full SHA for 81c054a

File tree

Expand file treeCollapse file tree

6 files changed

+31
-14
lines changed
Filter options
Expand file treeCollapse file tree

6 files changed

+31
-14
lines changed

‎.travis.yml

Copy file name to clipboardExpand all lines: .travis.yml
+17-8Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
language: php
22

3+
sudo: false
4+
5+
cache:
6+
directories:
7+
- $HOME/.composer/cache
8+
9+
addons:
10+
apt_packages:
11+
- parallel
12+
- language-pack-fr-base
13+
314
matrix:
415
include:
516
- php: 5.3
@@ -25,15 +36,13 @@ env:
2536
- SYMFONY_DEPRECATIONS_HELPER=weak
2637

2738
before_install:
28-
- travis_retry sudo apt-get install parallel
2939
- composer self-update
30-
- if [[ "$TRAVIS_PHP_VERSION" != "nightly" ]]; then phpenv config-rm xdebug.ini; fi;
31-
- if [[ "$TRAVIS_PHP_VERSION" != "nightly" ]]; then echo "extension = mongo.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi;
32-
- if [[ "$TRAVIS_PHP_VERSION" != "nightly" ]] && [ $(php -r "echo PHP_MINOR_VERSION;") -le 4 ]; then echo "extension = apc.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi;
33-
- if [[ "$TRAVIS_PHP_VERSION" != "nightly" ]]; then (pecl install -f memcached-2.1.0 && echo "extension = memcache.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini) || echo "Let's continue without memcache extension"; fi;
34-
- if [[ "$TRAVIS_PHP_VERSION" != "nightly" ]]; then (cd src/Symfony/Component/Debug/Resources/ext && phpize && ./configure && make && echo "extension = $(pwd)/modules/symfony_debug.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini); fi;
35-
- if [[ "$TRAVIS_PHP_VERSION" != "nightly" ]]; then php -i; fi;
36-
- sudo locale-gen fr_FR.UTF-8 && sudo update-locale
40+
- if [[ "$TRAVIS_PHP_VERSION" != "nightly" ]] && [[ "$TRAVIS_PHP_VERSION" != "hhvm" ]]; then phpenv config-rm xdebug.ini; fi;
41+
- if [[ "$TRAVIS_PHP_VERSION" != "nightly" ]] && [[ "$TRAVIS_PHP_VERSION" != "hhvm" ]]; then echo "extension = mongo.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi;
42+
- if [[ "$TRAVIS_PHP_VERSION" != "nightly" ]] && [[ "$TRAVIS_PHP_VERSION" != "hhvm" ]] && [ $(php -r "echo PHP_MINOR_VERSION;") -le 4 ]; then echo "extension = apc.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi;
43+
- if [[ "$TRAVIS_PHP_VERSION" != "nightly" ]] && [[ "$TRAVIS_PHP_VERSION" != "hhvm" ]]; then (pecl install -f memcached-2.1.0 && echo "extension = memcache.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini) || echo "Let's continue without memcache extension"; fi;
44+
- if [[ "$TRAVIS_PHP_VERSION" != "nightly" ]] && [[ "$TRAVIS_PHP_VERSION" != "hhvm" ]]; then (cd src/Symfony/Component/Debug/Resources/ext && phpize && ./configure && make && echo "extension = $(pwd)/modules/symfony_debug.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini); fi;
45+
- if [[ "$TRAVIS_PHP_VERSION" != "nightly" ]] && [[ "$TRAVIS_PHP_VERSION" != "hhvm" ]]; then php -i; fi;
3746
# Set the COMPOSER_ROOT_VERSION to the right version according to the branch being built
3847
- if [ "$TRAVIS_BRANCH" = "master" ]; then export COMPOSER_ROOT_VERSION=dev-master; else export COMPOSER_ROOT_VERSION="$TRAVIS_BRANCH".x-dev; fi;
3948

‎src/Symfony/Component/DependencyInjection/Container.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Container.php
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,6 @@ public function has($id)
259259
*
260260
* @return object The associated service
261261
*
262-
* @throws InvalidArgumentException if the service is not defined
263262
* @throws ServiceCircularReferenceException When a circular reference is detected
264263
* @throws ServiceNotFoundException When the service is not defined
265264
* @throws \Exception if an exception has been thrown when the service has been resolved

‎src/Symfony/Component/DependencyInjection/ContainerInterface.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/ContainerInterface.php
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ public function set($id, $service, $scope = self::SCOPE_CONTAINER);
5050
*
5151
* @return object The associated service
5252
*
53-
* @throws InvalidArgumentException if the service is not defined
5453
* @throws ServiceCircularReferenceException When a circular reference is detected
5554
* @throws ServiceNotFoundException When the service is not defined
5655
*

‎src/Symfony/Component/PropertyAccess/PropertyAccessor.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/PropertyAccess/PropertyAccessor.php
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -314,11 +314,11 @@ private function &readProperty(&$object, $property)
314314
$result[self::VALUE] = $object->$isser();
315315
} elseif ($reflClass->hasMethod($hasser) && $reflClass->getMethod($hasser)->isPublic()) {
316316
$result[self::VALUE] = $object->$hasser();
317-
} elseif ($reflClass->hasMethod('__get') && $reflClass->getMethod('__get')->isPublic()) {
318-
$result[self::VALUE] = $object->$property;
319317
} elseif ($classHasProperty && $reflClass->getProperty($property)->isPublic()) {
320318
$result[self::VALUE] = &$object->$property;
321319
$result[self::IS_REF] = true;
320+
} elseif ($reflClass->hasMethod('__get') && $reflClass->getMethod('__get')->isPublic()) {
321+
$result[self::VALUE] = $object->$property;
322322
} elseif (!$classHasProperty && property_exists($object, $property)) {
323323
// Needed to support \stdClass instances. We need to explicitly
324324
// exclude $classHasProperty, otherwise if in the previous clause
@@ -410,10 +410,10 @@ private function writeProperty(&$object, $property, $value)
410410
$object->$setter($value);
411411
} elseif ($this->isMethodAccessible($reflClass, $getsetter, 1)) {
412412
$object->$getsetter($value);
413-
} elseif ($this->isMethodAccessible($reflClass, '__set', 2)) {
414-
$object->$property = $value;
415413
} elseif ($classHasProperty && $reflClass->getProperty($property)->isPublic()) {
416414
$object->$property = $value;
415+
} elseif ($this->isMethodAccessible($reflClass, '__set', 2)) {
416+
$object->$property = $value;
417417
} elseif (!$classHasProperty && property_exists($object, $property)) {
418418
// Needed to support \stdClass instances. We need to explicitly
419419
// exclude $classHasProperty, otherwise if in the previous clause

‎src/Symfony/Component/PropertyAccess/Tests/Fixtures/TestClassMagicGet.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/PropertyAccess/Tests/Fixtures/TestClassMagicGet.php
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ class TestClassMagicGet
1515
{
1616
private $magicProperty;
1717

18+
public $publicProperty;
19+
1820
public function __construct($value)
1921
{
2022
$this->magicProperty = $value;

‎src/Symfony/Component/PropertyAccess/Tests/PropertyAccessorTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/PropertyAccess/Tests/PropertyAccessorTest.php
+8Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -438,4 +438,12 @@ public function testTicket5755()
438438

439439
$this->assertEquals('foobar', $object->getProperty());
440440
}
441+
442+
public function testSetValueDeepWithMagicGetter()
443+
{
444+
$obj = new TestClassMagicGet('foo');
445+
$obj->publicProperty = array('foo' => array('bar' => 'some_value'));
446+
$this->propertyAccessor->setValue($obj, 'publicProperty[foo][bar]', 'Updated');
447+
$this->assertSame('Updated', $obj->publicProperty['foo']['bar']);
448+
}
441449
}

0 commit comments

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