Permalink
Browse files

Merge branch '2.3' into 2.4

* 2.3:
  fixed typos
  Fixed deprecated method calls
  Add testing against HHVM at Travis-CI
  Fixed typo
  Fixed typo
  fixed acronyms
  [Validator] Fixed IBAN validator with 0750447346 value

Conflicts:
	src/Symfony/Component/HttpKernel/Debug/TraceableEventDispatcher.php
  • Loading branch information...
2 parents 79fe109 + a1ae703 commit 3a1d2200b0ca1548b21698d14370af63eae44828 @fabpot fabpot committed Dec 28, 2013
Showing with 58 additions and 45 deletions.
  1. +6 −1 .travis.yml
  2. +1 −1 src/Symfony/Bridge/Doctrine/Form/DoctrineOrmExtension.php
  3. +1 −1 src/Symfony/Bridge/Doctrine/Form/Type/DoctrineType.php
  4. +1 −1 src/Symfony/Bridge/Propel1/Form/PropelExtension.php
  5. +1 −1 src/Symfony/Bridge/Propel1/Form/Type/ModelType.php
  6. +2 −2 src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md
  7. +2 −2 src/Symfony/Bundle/FrameworkBundle/Resources/config/templating_php.xml
  8. +1 −1 src/Symfony/Bundle/FrameworkBundle/Templating/GlobalVariables.php
  9. +1 −1 src/Symfony/Bundle/FrameworkBundle/Test/WebTestCase.php
  10. +1 −1 src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php
  11. +3 −3 src/Symfony/Bundle/FrameworkBundle/Tests/Translation/TranslatorTest.php
  12. +1 −1 src/Symfony/Bundle/WebProfilerBundle/Controller/ProfilerController.php
  13. +3 −3 src/Symfony/Component/BrowserKit/Client.php
  14. +2 −2 src/Symfony/Component/Debug/ErrorHandler.php
  15. +2 −2 src/Symfony/Component/DomCrawler/Link.php
  16. +1 −1 src/Symfony/Component/DomCrawler/Tests/CrawlerTest.php
  17. +1 −1 src/Symfony/Component/Form/Extension/Core/ChoiceList/ObjectChoiceList.php
  18. +1 −1 src/Symfony/Component/Form/Extension/Core/CoreExtension.php
  19. +1 −1 src/Symfony/Component/Form/Extension/Core/Type/FormType.php
  20. +1 −1 src/Symfony/Component/HttpFoundation/RedirectResponse.php
  21. +4 −4 src/Symfony/Component/HttpFoundation/Request.php
  22. +1 −1 src/Symfony/Component/HttpFoundation/Response.php
  23. +2 −2 src/Symfony/Component/HttpFoundation/Tests/ParameterBagTest.php
  24. +1 −1 src/Symfony/Component/HttpFoundation/Tests/RequestTest.php
  25. +1 −1 src/Symfony/Component/HttpKernel/Debug/TraceableEventDispatcher.php
  26. +1 −1 src/Symfony/Component/HttpKernel/Kernel.php
  27. +1 −1 src/Symfony/Component/Process/Process.php
  28. +1 −1 src/Symfony/Component/Routing/Generator/ConfigurableRequirementsInterface.php
  29. +1 −1 src/Symfony/Component/Routing/Generator/UrlGenerator.php
  30. +1 −1 src/Symfony/Component/Security/Http/Firewall/ExceptionListener.php
  31. +2 −2 src/Symfony/Component/Security/Http/HttpUtils.php
  32. +1 −1 src/Symfony/Component/Translation/Loader/PoFileLoader.php
  33. +7 −0 src/Symfony/Component/Validator/Constraints/IbanValidator.php
  34. +1 −0 src/Symfony/Component/Validator/Tests/Constraints/IbanValidatorTest.php
View
@@ -5,12 +5,17 @@ php:
- 5.3
- 5.4
- 5.5
+ - hhvm
+
+matrix:
+ allow_failures:
+ - php: hhvm
services: mongodb
before_script:
- sudo apt-get install parallel
- - echo '' > ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini
+ - sh -c 'if [ $(php -r "echo (int) defined("HHVM_VERSION");") -eq 0 ]; then echo "" >> "~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini"; fi;'
- echo "extension = mongo.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
- sh -c 'if [ $(php -r "echo PHP_MINOR_VERSION;") -le 4 ]; then echo "extension = apc.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi;'
- echo "extension = memcached.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini
@@ -27,7 +27,7 @@ public function __construct(ManagerRegistry $registry)
protected function loadTypes()
{
return array(
- new Type\EntityType($this->registry, PropertyAccess::getPropertyAccessor()),
+ new Type\EntityType($this->registry, PropertyAccess::createPropertyAccessor()),
);
}
@@ -45,7 +45,7 @@
public function __construct(ManagerRegistry $registry, PropertyAccessorInterface $propertyAccessor = null)
{
$this->registry = $registry;
- $this->propertyAccessor = $propertyAccessor ?: PropertyAccess::getPropertyAccessor();
+ $this->propertyAccessor = $propertyAccessor ?: PropertyAccess::createPropertyAccessor();
}
public function buildForm(FormBuilderInterface $builder, array $options)
@@ -24,7 +24,7 @@ class PropelExtension extends AbstractExtension
protected function loadTypes()
{
return array(
- new Type\ModelType(PropertyAccess::getPropertyAccessor()),
+ new Type\ModelType(PropertyAccess::createPropertyAccessor()),
new Type\TranslationCollectionType(),
new Type\TranslationType()
);
@@ -57,7 +57,7 @@ class ModelType extends AbstractType
public function __construct(PropertyAccessorInterface $propertyAccessor = null)
{
- $this->propertyAccessor = $propertyAccessor ?: PropertyAccess::getPropertyAccessor();
+ $this->propertyAccessor = $propertyAccessor ?: PropertyAccess::createPropertyAccessor();
}
public function buildForm(FormBuilderInterface $builder, array $options)
@@ -45,8 +45,8 @@ CHANGELOG
* replaced Symfony\Component\HttpKernel\Debug\ContainerAwareTraceableEventDispatcher by Symfony\Component\HttpKernel\Debug\TraceableEventDispatcher
* added Client::enableProfiler()
* a new parameter has been added to the DIC: `router.request_context.base_url`
- You can customize it for your functional tests or for generating urls with
- the right base url when your are in the cli context.
+ You can customize it for your functional tests or for generating URLs with
+ the right base URL when your are in the CLI context.
* added support for default templates per render tag
2.1.0
@@ -57,8 +57,8 @@
<service id="templating.asset.request_aware_package" class="Symfony\Component\Templating\Asset\PackageInterface" factory-service="templating.asset.package_factory" factory-method="getPackage" abstract="true">
<argument type="service" id="request" strict="false" />
- <argument /> <!-- http id -->
- <argument /> <!-- ssl id -->
+ <argument /> <!-- HTTP id -->
+ <argument /> <!-- SSL id -->
</service>
<service id="templating.asset.package_factory" class="%templating.asset.package_factory.class%">
@@ -74,7 +74,7 @@ public function getUser()
/**
* Returns the current request.
*
- * @return Request|null The http request object
+ * @return Request|null The HTTP request object
*/
public function getRequest()
{
@@ -93,7 +93,7 @@ protected static function getPhpUnitXmlDir()
* PHPUnit will use the last configuration argument on the command line, so this only returns
* the last configuration argument.
*
- * @return string The value of the PHPUnit cli configuration option
+ * @return string The value of the PHPUnit CLI configuration option
*/
private static function getPhpUnitCliConfigArgument()
{
@@ -153,7 +153,7 @@ public function testTemplating()
$this->assertEquals('request', $container->getDefinition('templating.helper.assets')->getScope(), '->registerTemplatingConfiguration() sets request scope on assets helper if one or more packages are request-scoped');
- // default package should have one http base url and path package ssl url
+ // default package should have one HTTP base URL and path package SSL URL
$this->assertTrue($container->hasDefinition('templating.asset.default_package.http'));
$package = $container->getDefinition('templating.asset.default_package.http');
$this->assertInstanceOf('Symfony\\Component\\DependencyInjection\\DefinitionDecorator', $package);
@@ -45,7 +45,7 @@ public function testTransWithoutCaching()
{
$translator = $this->getTranslator($this->getLoader());
$translator->setLocale('fr');
- $translator->setFallbackLocale(array('en', 'es', 'pt-PT', 'pt_BR'));
+ $translator->setFallbackLocales(array('en', 'es', 'pt-PT', 'pt_BR'));
$this->assertEquals('foo (FR)', $translator->trans('foo'));
$this->assertEquals('bar (EN)', $translator->trans('bar'));
@@ -61,7 +61,7 @@ public function testTransWithCaching()
// prime the cache
$translator = $this->getTranslator($this->getLoader(), array('cache_dir' => $this->tmpDir));
$translator->setLocale('fr');
- $translator->setFallbackLocale(array('en', 'es', 'pt-PT', 'pt_BR'));
+ $translator->setFallbackLocales(array('en', 'es', 'pt-PT', 'pt_BR'));
$this->assertEquals('foo (FR)', $translator->trans('foo'));
$this->assertEquals('bar (EN)', $translator->trans('bar'));
@@ -75,7 +75,7 @@ public function testTransWithCaching()
$loader = $this->getMock('Symfony\Component\Translation\Loader\LoaderInterface');
$translator = $this->getTranslator($loader, array('cache_dir' => $this->tmpDir));
$translator->setLocale('fr');
- $translator->setFallbackLocale(array('en', 'es', 'pt-PT', 'pt_BR'));
+ $translator->setFallbackLocales(array('en', 'es', 'pt-PT', 'pt_BR'));
$this->assertEquals('foo (FR)', $translator->trans('foo'));
$this->assertEquals('bar (EN)', $translator->trans('bar'));
@@ -37,7 +37,7 @@ class ProfilerController
/**
* Constructor.
*
- * @param UrlGeneratorInterface $generator The Url Generator
+ * @param UrlGeneratorInterface $generator The URL Generator
* @param Profiler $profiler The profiler
* @param \Twig_Environment $twig The twig environment
* @param array $templates The templates
@@ -412,7 +412,7 @@ protected function filterResponse($response)
*
* This method returns null if the DomCrawler component is not available.
*
- * @param string $uri A uri
+ * @param string $uri A URI
* @param string $content Content for the crawler to use
* @param string $type Content type
*
@@ -534,9 +534,9 @@ public function restart()
/**
* Takes a URI and converts it to absolute if it is not already absolute.
*
- * @param string $uri A uri
+ * @param string $uri A URI
*
- * @return string An absolute uri
+ * @return string An absolute URI
*/
protected function getAbsoluteUri($uri)
{
@@ -161,10 +161,10 @@ function ($row) {
// we must stop the PHP script execution, as the exception has
// already been dealt with, so, let's throw an exception that
- // will be catched by a dummy exception handler
+ // will be caught by a dummy exception handler
set_exception_handler(function (\Exception $e) use ($exceptionHandler) {
if (!$e instanceof DummyException) {
- // happens if our dummy exception is catched by a
+ // happens if our dummy exception is caught by a
// catch-all from user code, in which case, let's the
// current handler handle this "new" exception
call_user_func($exceptionHandler, $e);
@@ -112,7 +112,7 @@ public function getUri()
if ('?' === $uri[0]) {
$baseUri = $this->currentUri;
- // remove the query string from the current uri
+ // remove the query string from the current URI
if (false !== $pos = strpos($baseUri, '?')) {
$baseUri = substr($baseUri, 0, $pos);
}
@@ -140,7 +140,7 @@ public function getUri()
}
/**
- * Returns raw uri data.
+ * Returns raw URI data.
*
* @return string
*/
@@ -712,7 +712,7 @@ public function testBaseTag()
$this->assertEquals('http://base.com/link', $crawler->filterXPath('//a')->link()->getUri());
$crawler = new Crawler('<html><base href="//base.com"><a href="link"></a></html>', 'https://domain.com');
- $this->assertEquals('https://base.com/link', $crawler->filterXPath('//a')->link()->getUri(), '<base> tag can use a schema-less url');
+ $this->assertEquals('https://base.com/link', $crawler->filterXPath('//a')->link()->getUri(), '<base> tag can use a schema-less URL');
$crawler = new Crawler('<html><base href="path/"><a href="link"></a></html>', 'https://domain.com');
$this->assertEquals('https://domain.com/path/link', $crawler->filterXPath('//a')->link()->getUri(), '<base> tag can set a path');
@@ -87,7 +87,7 @@ class ObjectChoiceList extends ChoiceList
*/
public function __construct($choices, $labelPath = null, array $preferredChoices = array(), $groupPath = null, $valuePath = null, PropertyAccessorInterface $propertyAccessor = null)
{
- $this->propertyAccessor = $propertyAccessor ?: PropertyAccess::getPropertyAccessor();
+ $this->propertyAccessor = $propertyAccessor ?: PropertyAccess::createPropertyAccessor();
$this->labelPath = null !== $labelPath ? new PropertyPath($labelPath) : null;
$this->groupPath = null !== $groupPath ? new PropertyPath($groupPath) : null;
$this->valuePath = null !== $valuePath ? new PropertyPath($valuePath) : null;
@@ -24,7 +24,7 @@ class CoreExtension extends AbstractExtension
protected function loadTypes()
{
return array(
- new Type\FormType(PropertyAccess::getPropertyAccessor()),
+ new Type\FormType(PropertyAccess::createPropertyAccessor()),
new Type\BirthdayType(),
new Type\CheckboxType(),
new Type\ChoiceType(),
@@ -31,7 +31,7 @@ class FormType extends BaseType
public function __construct(PropertyAccessorInterface $propertyAccessor = null)
{
- $this->propertyAccessor = $propertyAccessor ?: PropertyAccess::getPropertyAccessor();
+ $this->propertyAccessor = $propertyAccessor ?: PropertyAccess::createPropertyAccessor();
}
/**
@@ -27,7 +27,7 @@ class RedirectResponse extends Response
*
* @param string $url The URL to redirect to
* @param integer $status The status code (302 by default)
- * @param array $headers The headers (Location is always set to the given url)
+ * @param array $headers The headers (Location is always set to the given URL)
*
* @throws \InvalidArgumentException
*
@@ -881,14 +881,14 @@ public function getBasePath()
}
/**
- * Returns the root url from which this request is executed.
+ * Returns the root URL from which this request is executed.
*
* The base URL never ends with a /.
*
* This is similar to getBasePath(), except that it also includes the
* script filename (e.g. index.php) if one exists.
*
- * @return string The raw url (i.e. not urldecoded)
+ * @return string The raw URL (i.e. not urldecoded)
*
* @api
*/
@@ -1615,13 +1615,13 @@ protected function prepareRequestUri()
$requestUri = $this->headers->get('X_REWRITE_URL');
$this->headers->remove('X_REWRITE_URL');
} elseif ($this->server->get('IIS_WasUrlRewritten') == '1' && $this->server->get('UNENCODED_URL') != '') {
- // IIS7 with URL Rewrite: make sure we get the unencoded url (double slash problem)
+ // IIS7 with URL Rewrite: make sure we get the unencoded URL (double slash problem)
$requestUri = $this->server->get('UNENCODED_URL');
$this->server->remove('UNENCODED_URL');
$this->server->remove('IIS_WasUrlRewritten');
} elseif ($this->server->has('REQUEST_URI')) {
$requestUri = $this->server->get('REQUEST_URI');
- // HTTP proxy reqs setup request uri with scheme and host [and port] + the url path, only use url path
+ // HTTP proxy reqs setup request URI with scheme and host [and port] + the URL path, only use URL path
$schemeAndHttpHost = $this->getSchemeAndHttpHost();
if (strpos($requestUri, $schemeAndHttpHost) === 0) {
$requestUri = substr($requestUri, strlen($schemeAndHttpHost));
@@ -1242,7 +1242,7 @@ public function isEmpty()
}
/**
- * Check if we need to remove Cache-Control for ssl encrypted downloads when using IE < 9
+ * Check if we need to remove Cache-Control for SSL encrypted downloads when using IE < 9
*
* @link http://support.microsoft.com/kb/323308
*/
@@ -205,10 +205,10 @@ public function testFilter()
$this->assertEquals('example@example.com', $bag->filter('email', '', false, FILTER_VALIDATE_EMAIL), '->filter() gets a value of parameter as email');
- $this->assertEquals('http://example.com/foo', $bag->filter('url', '', false, FILTER_VALIDATE_URL, array('flags' => FILTER_FLAG_PATH_REQUIRED)), '->filter() gets a value of parameter as url with a path');
+ $this->assertEquals('http://example.com/foo', $bag->filter('url', '', false, FILTER_VALIDATE_URL, array('flags' => FILTER_FLAG_PATH_REQUIRED)), '->filter() gets a value of parameter as URL with a path');
// This test is repeated for code-coverage
- $this->assertEquals('http://example.com/foo', $bag->filter('url', '', false, FILTER_VALIDATE_URL, FILTER_FLAG_PATH_REQUIRED), '->filter() gets a value of parameter as url with a path');
+ $this->assertEquals('http://example.com/foo', $bag->filter('url', '', false, FILTER_VALIDATE_URL, FILTER_FLAG_PATH_REQUIRED), '->filter() gets a value of parameter as URL with a path');
$this->assertFalse($bag->filter('dec', '', false, FILTER_VALIDATE_INT, array(
'flags' => FILTER_FLAG_ALLOW_HEX,
@@ -715,7 +715,7 @@ public function testGetPort()
));
$port = $request->getPort();
- $this->assertEquals(80, $port, 'If X_FORWARDED_PROTO is set to http return 80.');
+ $this->assertEquals(80, $port, 'If X_FORWARDED_PROTO is set to HTTP return 80.');
$request = Request::create('http://example.com', 'GET', array(), array(), array(), array(
'HTTP_X_FORWARDED_PROTO' => 'On'
@@ -259,7 +259,7 @@ public function preListenerCall($eventName, $listener)
* @param object $listener The listener
* @param string $eventName The event name
*
- * @return array Informations about the listener
+ * @return array Information about the listener
*/
private function getListenerInfo($listener, $eventName)
{
@@ -187,7 +187,7 @@ public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQ
}
/**
- * Gets a http kernel from the container
+ * Gets a HTTP kernel from the container
*
* @return HttpKernel
*/
@@ -1123,7 +1123,7 @@ private function readPipes($blocking, $close)
}
/**
- * Captures the exitcode if mentioned in the process informations.
+ * Captures the exitcode if mentioned in the process information.
*/
private function captureExitCode()
{
@@ -25,7 +25,7 @@
* params because they come from third party libs but don't want to have a 404 in
* production environment. It should log the mismatch so one can review it.
* - setStrictRequirements(null): Return the URL with the given parameters without
- * checking the requirements at all. When generating an URL you should either trust
+ * checking the requirements at all. When generating a URL you should either trust
* your params or you validated them beforehand because otherwise it would break your
* link anyway. So in production environment you should know that params always pass
* the requirements. Thus this option allows to disable the check on URL generation for
@@ -188,7 +188,7 @@ protected function doGenerate($variables, $defaults, $requirements, $tokens, $pa
$url = '/';
}
- // the contexts base url is already encoded (see Symfony\Component\HttpFoundation\Request)
+ // the contexts base URL is already encoded (see Symfony\Component\HttpFoundation\Request)
$url = strtr(rawurlencode($url), $this->decodedChars);
// the path segments "." and ".." are interpreted as relative reference when resolving a URI; see http://tools.ietf.org/html/rfc3986#section-3.3
@@ -199,7 +199,7 @@ private function startAuthentication(Request $request, AuthenticationException $
*/
protected function setTargetPath(Request $request)
{
- // session isn't required when using http basic authentication mechanism for example
+ // session isn't required when using HTTP basic authentication mechanism for example
if ($request->hasSession() && $request->isMethodSafe()) {
$request->getSession()->set('_security.'.$this->providerKey.'.target_path', $request->getUri());
}
@@ -35,7 +35,7 @@ class HttpUtils
* Constructor.
*
* @param UrlGeneratorInterface $urlGenerator A UrlGeneratorInterface instance
- * @param UrlMatcherInterface|RequestMatcherInterface $urlMatcher The Url or Request matcher
+ * @param UrlMatcherInterface|RequestMatcherInterface $urlMatcher The URL or Request matcher
*
* @throws \InvalidArgumentException
*/
@@ -146,7 +146,7 @@ public function generateUri($request, $path)
$url = $this->urlGenerator->generate($path, $request->attributes->all(), UrlGeneratorInterface::ABSOLUTE_URL);
- // unnecessary query string parameters must be removed from url
+ // unnecessary query string parameters must be removed from URL
// (ie. query parameters that are presents in $attributes)
// fortunately, they all are, so we have to remove entire query string
$position = strpos($url, '?');
@@ -146,7 +146,7 @@ private function parse($resource)
}
/**
- * Save a translation item to the messeages.
+ * Save a translation item to the messages.
*
* A .po file could contain by error missing plural indexes. We need to
* fix these before saving them.
@@ -30,6 +30,13 @@ public function validate($value, Constraint $constraint)
return;
}
+ // An IBAN without a country code is not an IBAN.
+ if (0 === preg_match('/[A-Za-z]/', $value)) {
+ $this->context->addViolation($constraint->message, array('{{ value }}' => $value));
+
+ return;
+ }
+
$teststring = preg_replace('/\s+/', '', $value);
if (strlen($teststring) < 4) {
Oops, something went wrong.

0 comments on commit 3a1d220

Please sign in to comment.