Merge branch '2.7' into 2.8

* 2.7:
  [VarDumper] Fix missing support for dumping PHP7 return type
  [travis] disable symfony_debug ext when deps!=no
  Do not normalize the kernel root directory path (see symfony/symfony#15474).
  Don't trigger deprecation on interfaces
  [Debug] Ignore silencing for deprecations
  [ci] Run minimal versions on appveyor only
  Fix appveyor file
  consistently use str_replace to unify directory separators (remaining)
This commit is contained in:
Fabien Potencier 2015-08-31 14:33:08 +02:00
commit 82ed1bed6b
14 changed files with 44 additions and 20 deletions

View File

@ -33,7 +33,7 @@ before_install:
- if [[ "$TRAVIS_PHP_VERSION" = 5.* ]]; then echo "extension = mongo.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi;
- if [[ "$TRAVIS_PHP_VERSION" =~ 5.[34] ]]; then echo "extension = apc.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi;
- if [[ "$TRAVIS_PHP_VERSION" = 5.* ]]; 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;
- if [[ "$TRAVIS_PHP_VERSION" = 5.* ]]; 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;
- if [[ "$TRAVIS_PHP_VERSION" = 5.* ]] && [ "$deps" = "no" ]; 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;
- if [[ "$TRAVIS_PHP_VERSION" != "hhvm" ]]; then php -i; fi;
- ./phpunit install
- export PHPUNIT="$(readlink -f ./phpunit)"

View File

@ -22,15 +22,17 @@ init:
install:
- IF EXIST c:\php (SET PHP=0) ELSE (mkdir c:\php)
- cd c:\php
- IF %PHP%==1 appveyor DownloadFile http://windows.php.net/downloads/releases/archives/php-5.4.43-nts-Win32-VC9-x86.zip
- IF %PHP%==1 7z x php-5.4.43-nts-Win32-VC9-x86.zip -y > 7z.log
- IF %PHP%==1 appveyor DownloadFile http://windows.php.net/downloads/releases/archives/php-5.3.3-nts-Win32-VC9-x86.zip
- IF %PHP%==1 7z x php-5.3.3-nts-Win32-VC9-x86.zip -y > 7z.log
- IF %PHP%==1 appveyor DownloadFile http://nebm.ist.utl.pt/~glopes/misc/intl_win/ICU-51.2-dlls.zip
- IF %PHP%==1 7z x ICU-51.2-dlls.zip -y > 7z.log
- IF %PHP%==1 cd ext
- IF %PHP%==1 appveyor DownloadFile http://nebm.ist.utl.pt/~glopes/misc/intl_win/php_intl-3.0.0-5.4-nts-vc9-x86.zip
- IF %PHP%==1 7z x php_intl-3.0.0-5.4-nts-vc9-x86.zip -y > 7z.log
- IF %PHP%==1 appveyor DownloadFile http://windows.php.net/downloads/pecl/releases/apc/3.1.13/php_apc-3.1.13-5.4-nts-vc9-x86.zip
- IF %PHP%==1 7z x php_apc-3.1.13-5.4-nts-vc9-x86.zip -y > 7z.log
- IF %PHP%==1 appveyor DownloadFile http://nebm.ist.utl.pt/~glopes/misc/intl_win/php_intl-3.0.0-5.3-nts-vc9-x86.zip
- IF %PHP%==1 7z x php_intl-3.0.0-5.3-nts-vc9-x86.zip -y > 7z.log
- IF %PHP%==1 appveyor DownloadFile http://windows.php.net/downloads/pecl/releases/apc/3.1.13/php_apc-3.1.13-5.3-nts-vc9-x86.zip
- IF %PHP%==1 7z x php_apc-3.1.13-5.3-nts-vc9-x86.zip -y > 7z.log
- IF %PHP%==1 appveyor DownloadFile http://windows.php.net/downloads/pecl/releases/memcache/3.0.8/php_memcache-3.0.8-5.3-nts-vc9-x86.zip
- IF %PHP%==1 7z x php_memcache-3.0.8-5.3-nts-vc9-x86.zip -y > 7z.log
- IF %PHP%==1 cd ..
- IF %PHP%==1 echo @php %%~dp0composer.phar %%* > composer.bat
- appveyor DownloadFile https://getcomposer.org/composer.phar

View File

@ -106,7 +106,7 @@ class SetAclCommandTest extends WebTestCase
$setAclCommandTester = new CommandTester($setAclCommand);
$setAclCommandTester->execute(array(
'command' => 'acl:set',
'arguments' => array($grantedPermission, sprintf('%s:%s', strtr(self::OBJECT_CLASS, '\\', '/'), $objectId)),
'arguments' => array($grantedPermission, sprintf('%s:%s', str_replace('\\', '/', self::OBJECT_CLASS), $objectId)),
'--role' => array($role),
));

View File

@ -353,7 +353,7 @@ class ErrorHandler
*/
public function handleError($type, $message, $file, $line, array $context, array $backtrace = null)
{
$level = error_reporting() | E_RECOVERABLE_ERROR | E_USER_ERROR;
$level = error_reporting() | E_RECOVERABLE_ERROR | E_USER_ERROR | E_DEPRECATED | E_USER_DEPRECATED;
$log = $this->loggedErrors & $type;
$throw = $this->thrownErrors & $type & $level;
$type &= $level | $this->screamedErrors;

View File

@ -295,6 +295,28 @@ class ErrorHandlerTest extends \PHPUnit_Framework_TestCase
}
}
public function testHandleDeprecation()
{
$that = $this;
$logArgCheck = function ($level, $message, $context) use ($that) {
$that->assertEquals(LogLevel::INFO, $level);
$that->assertArrayHasKey('level', $context);
$that->assertEquals(E_RECOVERABLE_ERROR | E_USER_ERROR | E_DEPRECATED | E_USER_DEPRECATED, $context['level']);
$that->assertArrayHasKey('stack', $context);
};
$logger = $this->getMock('Psr\Log\LoggerInterface');
$logger
->expects($this->once())
->method('log')
->will($this->returnCallback($logArgCheck))
;
$handler = new ErrorHandler();
$handler->setDefaultLogger($logger);
@$handler->handleError(E_USER_DEPRECATED, 'Foo deprecation', __FILE__, __LINE__, array());
}
public function testHandleException()
{
try {

View File

@ -120,7 +120,7 @@ class DumpDataCollector extends DataCollector implements DataDumperInterface
}
if (false === $name) {
$name = strtr($file, '\\', '/');
$name = str_replace('\\', '/', $file);
$name = substr($name, strrpos($name, '/') + 1);
}

View File

@ -15,8 +15,6 @@
namespace Symfony\Component\HttpKernel\HttpCache;
@trigger_error('The '.__NAMESPACE__.'\EsiResponseCacheStrategyInterface class is deprecated since version 2.6 and will be removed in 3.0. Use the Symfony\Component\HttpKernel\HttpCache\ResponseCacheStrategyInterface class instead.', E_USER_DEPRECATED);
/**
* ResponseCacheStrategyInterface implementations know how to compute the
* Response cache HTTP header based on the different response cache headers.

View File

@ -362,7 +362,7 @@ abstract class Kernel implements KernelInterface, TerminableInterface
{
if (null === $this->rootDir) {
$r = new \ReflectionObject($this);
$this->rootDir = str_replace('\\', '/', dirname($r->getFileName()));
$this->rootDir = dirname($r->getFileName());
}
return $this->rootDir;

View File

@ -862,7 +862,7 @@ class NumberFormatter
// The negative PHP_INT_MAX was being converted to float
if (
$value == self::$int32Range['negative'] &&
((PHP_VERSION_ID < 50400 && PHP_VERSION_ID >= 50314) || PHP_VERSION_ID >= 50404)
((PHP_VERSION_ID < 50400 && PHP_VERSION_ID >= 50314) || PHP_VERSION_ID >= 50404 || (extension_loaded('intl') && method_exists('IntlDateFormatter', 'setTimeZone')))
) {
return (int) $value;
}
@ -875,7 +875,8 @@ class NumberFormatter
// A 32 bit integer was being generated instead of a 64 bit integer
if (
($value > self::$int32Range['positive'] || $value < self::$int32Range['negative']) &&
(PHP_VERSION_ID < 50314 || (PHP_VERSION_ID >= 50400 && PHP_VERSION_ID < 50404))
(PHP_VERSION_ID < 50314 || (PHP_VERSION_ID >= 50400 && PHP_VERSION_ID < 50404)) &&
!(extension_loaded('intl') && method_exists('IntlDateFormatter', 'setTimeZone'))
) {
$value = (-2147483648 - ($value % -2147483648)) * ($value / abs($value));
}

View File

@ -686,7 +686,7 @@ abstract class AbstractNumberFormatterTest extends \PHPUnit_Framework_TestCase
// Bug #59597 was fixed on PHP 5.3.14 and 5.4.4
// The negative PHP_INT_MAX was being converted to float
if ((PHP_VERSION_ID < 50400 && PHP_VERSION_ID >= 50314) || PHP_VERSION_ID >= 50404) {
if ((PHP_VERSION_ID < 50400 && PHP_VERSION_ID >= 50314) || PHP_VERSION_ID >= 50404 || (extension_loaded('intl') && method_exists('IntlDateFormatter', 'setTimeZone'))) {
$this->assertInternalType('int', $parsedValue);
} else {
$this->assertInternalType('float', $parsedValue);

View File

@ -11,8 +11,6 @@
namespace Symfony\Component\Security\Core;
@trigger_error('The '.__NAMESPACE__.'\SecurityContextInterface interface is deprecated since version 2.6 and will be removed in 3.0.', E_USER_DEPRECATED);
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;

View File

@ -11,8 +11,6 @@
namespace Symfony\Component\Templating\Asset;
@trigger_error('The Symfony\Component\Templating\Asset\PackageInterface is deprecated since version 2.7 and will be removed in 3.0. Use the Asset component instead.', E_USER_DEPRECATED);
/**
* Asset package interface.
*

View File

@ -129,6 +129,10 @@ abstract class AbstractComparisonValidatorTestCase extends AbstractConstraintVal
// Make sure we have the correct version loaded
if ($dirtyValue instanceof \DateTime || $dirtyValue instanceof \DateTimeInterface) {
IntlTestHelper::requireIntl($this);
if (PHP_VERSION_ID < 50304 && !(extension_loaded('intl') && method_exists('IntlDateFormatter', 'setTimeZone'))) {
$this->markTestSkipped('Intl supports formatting DateTime objects since 5.3.4');
}
}
$constraint = $this->createConstraint(array('value' => $comparedValue));

View File

@ -109,6 +109,7 @@ class ReflectionCaster
self::addMap($a, $c, array(
'returnsReference' => 'returnsReference',
'returnType' => 'getReturnType',
'class' => 'getClosureScopeClass',
'this' => 'getClosureThis',
));