Merge branch '2.8'

* 2.8:
  fixes CS
  fixed CS
  [DependencyInjection] Add missing file headers
  fixed typo
  made Symfony compatible with both Twig 1.x and 2.x
  [FrameworkBundle] Fix precedence of xdebug.file_link_format
This commit is contained in:
Fabien Potencier 2015-08-24 09:21:16 +02:00
commit dcc80c7b8a
175 changed files with 369 additions and 295 deletions

View File

@ -75,20 +75,23 @@ abstract class RegisterMappingsPass implements CompilerPassInterface
/**
* Naming pattern for the configuration service id, for example
* 'doctrine.orm.%s_configuration'
* 'doctrine.orm.%s_configuration'.
*
* @var string
*/
private $configurationPattern;
/**
* Method name to call on the configuration service. This depends on the
* Doctrine implementation. For example addEntityNamespace
* Doctrine implementation. For example addEntityNamespace.
*
* @var string
*/
private $registerAliasMethodName;
/**
* Map of alias to namespace.
*
* @var string[]
*/
private $aliasMap;

View File

@ -129,7 +129,6 @@ abstract class DoctrineType extends AbstractType
$choiceLoader = function (Options $options) {
// Unless the choices are given explicitly, load them on demand
if (null === $options['choices']) {
$hash = null;
$qbParts = null;
@ -137,7 +136,6 @@ abstract class DoctrineType extends AbstractType
// also if concrete Type can return important QueryBuilder parts to generate
// hash key we go for it as well
if (!$options['query_builder'] || false !== ($qbParts = $this->getQueryBuilderPartsForCachingHash($options['query_builder']))) {
$hash = CachingFactoryDecorator::generateHash(array(
$options['em'],
$options['class'],

View File

@ -162,10 +162,10 @@ class DoctrineExtensionTest extends \PHPUnit_Framework_TestCase
$newEmConfigs = $method->invoke($this->extension, $emConfigs, $bundles);
$this->assertEquals($newEmConfigs["em1"], array_merge(array(
$this->assertEquals($newEmConfigs['em1'], array_merge(array(
'auto_mapping' => false,
), $expectedEm1));
$this->assertEquals($newEmConfigs["em2"], array_merge(array(
$this->assertEquals($newEmConfigs['em2'], array_merge(array(
'auto_mapping' => false,
), $expectedEm2));
}

View File

@ -45,7 +45,7 @@ class SwiftMailerHandler extends BaseSwiftMailerHandler
}
/**
* After the CLI application has been terminated we will always flush messages
* After the CLI application has been terminated we will always flush messages.
*
* @param ConsoleTerminateEvent $event
*/

View File

@ -172,7 +172,7 @@ EOF
if ($info['valid'] && $output->isVerbose()) {
$output->writeln('<info>OK</info>'.($info['file'] ? sprintf(' in %s', $info['file']) : ''));
} elseif (!$info['valid']) {
$errors++;
++$errors;
$this->renderException($output, $info['template'], $info['exception'], $info['file']);
}
}
@ -192,7 +192,7 @@ EOF
if (!$v['valid']) {
$v['message'] = $v['exception']->getMessage();
unset($v['exception']);
$errors++;
++$errors;
}
});
@ -203,7 +203,7 @@ EOF
private function renderException(OutputInterface $output, $template, \Twig_Error $exception, $file = null)
{
$line = $exception->getTemplateLine();
$line = $exception->getTemplateLine();
if ($file) {
$output->writeln(sprintf('<error>KO</error> in %s (line %s)', $file, $line));
@ -234,7 +234,7 @@ EOF
$result = array();
while ($position < $max) {
$result[$position + 1] = $lines[$position];
$position++;
++$position;
}
return $result;

View File

@ -116,7 +116,7 @@ class TwigDataCollector extends DataCollector implements LateDataCollectorInterf
if (!isset($templates[$p->getTemplate()])) {
$templates[$p->getTemplate()] = 1;
} else {
$templates[$p->getTemplate()]++;
++$templates[$p->getTemplate()];
}
}

View File

@ -18,6 +18,6 @@ class StubFilesystemLoader extends \Twig_Loader_Filesystem
// strip away bundle name
$parts = explode(':', $name);
return parent::findTemplate(end($parts));
return parent::findTemplate(end($parts), $throw);
}
}

View File

@ -26,8 +26,8 @@ class DebugExtensionTest extends \PHPUnit_Framework_TestCase
$expectedTags = array(
array(
"id" => "dump",
"template" => "@Debug/Profiler/dump.html.twig",
'id' => 'dump',
'template' => '@Debug/Profiler/dump.html.twig',
),
);

View File

@ -130,7 +130,7 @@ EOF
if ($info['valid'] && $output->isVerbose()) {
$output->writeln('<info>OK</info>'.($info['file'] ? sprintf(' in %s', $info['file']) : ''));
} elseif (!$info['valid']) {
$errors++;
++$errors;
$output->writeln(sprintf('<error>KO</error> in %s', $info['file']));
$output->writeln(sprintf('<error>>> %s</error>', $info['message']));
}
@ -148,7 +148,7 @@ EOF
array_walk($filesInfo, function (&$v) use (&$errors) {
$v['file'] = (string) $v['file'];
if (!$v['valid']) {
$errors++;
++$errors;
}
});

View File

@ -119,7 +119,7 @@ class ControllerNameParser
}
/**
* Attempts to find a bundle that is *similar* to the given bundle name
* Attempts to find a bundle that is *similar* to the given bundle name.
*
* @param string $nonExistentBundleName
*

View File

@ -471,14 +471,17 @@ class FrameworkExtension extends Extension
{
$loader->load('templating.xml');
$links = array(
'textmate' => 'txmt://open?url=file://%%f&line=%%l',
'macvim' => 'mvim://open?url=file://%%f&line=%%l',
'emacs' => 'emacs://open?url=file://%%f&line=%%l',
'sublime' => 'subl://open?url=file://%%f&line=%%l',
);
if (!$container->hasParameter('templating.helper.code.file_link_format')) {
$links = array(
'textmate' => 'txmt://open?url=file://%%f&line=%%l',
'macvim' => 'mvim://open?url=file://%%f&line=%%l',
'emacs' => 'emacs://open?url=file://%%f&line=%%l',
'sublime' => 'subl://open?url=file://%%f&line=%%l',
);
$container->setParameter('templating.helper.code.file_link_format', ini_get('xdebug.file_link_format') ?: get_cfg_var('xdebug.file_link_format') ?: (isset($links[$ide]) ? $links[$ide] : $ide));
}
$container->setParameter('templating.helper.code.file_link_format', isset($links[$ide]) ? $links[$ide] : $ide);
$container->setParameter('fragment.renderer.hinclude.global_template', $config['hinclude_default_template']);
if ($container->getParameter('kernel.debug')) {

View File

@ -74,7 +74,7 @@ class ObjectsProvider
$builder->setParameter('database_name', 'symfony');
return array(
'parameter' => $builder,
'parameter' => $builder,
);
}

View File

@ -98,6 +98,7 @@ class ControllerTest extends TestCase
/**
* @param $token
*
* @return ContainerInterface
*/
private function getContainerWithTokenStorage($token = null)

View File

@ -12,8 +12,6 @@
namespace Symfony\Bundle\FrameworkBundle\Tests\DependencyInjection\Compiler;
use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\LoggingTranslatorPass;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;
class LoggingTranslatorPassTest extends \PHPUnit_Framework_TestCase
{
@ -46,7 +44,7 @@ class LoggingTranslatorPassTest extends \PHPUnit_Framework_TestCase
$definition->expects($this->once())
->method('getClass')
->will($this->returnValue("Symfony\Bundle\FrameworkBundle\Translation\Translator"));
->will($this->returnValue('Symfony\Bundle\FrameworkBundle\Translation\Translator'));
$parameterBag->expects($this->once())
->method('resolveValue')

View File

@ -24,7 +24,7 @@ use Symfony\Component\Security\Acl\Permission\MaskBuilder;
use Symfony\Component\Security\Acl\Model\MutableAclProviderInterface;
/**
* Sets ACL for objects
* Sets ACL for objects.
*
* @author Kévin Dunglas <kevin@les-tilleuls.coop>
*/
@ -162,7 +162,7 @@ EOF
}
/**
* Gets the mask builder
* Gets the mask builder.
*
* @return MaskBuilder
*/

View File

@ -12,7 +12,7 @@
namespace Symfony\Bundle\SecurityBundle\Tests\Functional\Bundle\AclBundle\Entity;
/**
* Car
* Car.
*
* @author Kévin Dunglas <kevin@les-tilleuls.coop>
*/

View File

@ -21,7 +21,7 @@ use Symfony\Component\Security\Acl\Exception\NoAceFoundException;
use Symfony\Component\Security\Acl\Permission\BasicPermissionMap;
/**
* Tests SetAclCommand
* Tests SetAclCommand.
*
* @author Kévin Dunglas <kevin@les-tilleuls.coop>
*/

View File

@ -18,7 +18,7 @@ use Symfony\Component\Security\Core\Encoder\BCryptPasswordEncoder;
use Symfony\Component\Security\Core\Encoder\Pbkdf2PasswordEncoder;
/**
* Tests UserPasswordEncoderCommand
* Tests UserPasswordEncoderCommand.
*
* @author Sarah Khalil <mkhalil.sarah@gmail.com>
*/

View File

@ -23,7 +23,7 @@ class PreviewErrorControllerTest extends TestCase
public function testForwardRequestToConfiguredController()
{
$request = Request::create('whatever');
$response = new Response("");
$response = new Response('');
$code = 123;
$logicalControllerName = 'foo:bar:baz';

View File

@ -14,7 +14,7 @@ namespace Symfony\Bundle\WebProfilerBundle\Twig;
use Symfony\Component\HttpKernel\DataCollector\Util\ValueExporter;
/**
* Twig extension for the profiler
* Twig extension for the profiler.
*
* @author Fabien Potencier <fabien@symfony.com>
*/

View File

@ -11,8 +11,6 @@
namespace Symfony\Component\Asset\Context;
use Symfony\Component\HttpFoundation\RequestStack;
/**
* A context that does nothing.
*

View File

@ -67,7 +67,7 @@ class Packages
* @return PackageInterface An asset package
*
* @throws InvalidArgumentException If there is no package by that name
* @throws LogicException If no default package is defined
* @throws LogicException If no default package is defined
*/
public function getPackage($name = null)
{

View File

@ -23,8 +23,8 @@ interface ConfigCacheFactoryInterface
/**
* Creates a cache instance and (re-)initializes it if necessary.
*
* @param string $file The absolute cache file path
* @param callable $callable The callable to be executed when the cache needs to be filled (i. e. is not fresh). The cache will be passed as the only parameter to this callback
* @param string $file The absolute cache file path
* @param callable $callable The callable to be executed when the cache needs to be filled (i. e. is not fresh). The cache will be passed as the only parameter to this callback
*
* @return ConfigCacheInterface $configCache The cache instance
*/

View File

@ -14,7 +14,7 @@ namespace Symfony\Component\Config;
use Symfony\Component\Config\Resource\ResourceInterface;
/**
* Interface for ConfigCache
* Interface for ConfigCache.
*
* @author Matthias Pigulla <mp@webfactory.de>
*/

View File

@ -247,7 +247,7 @@ class XmlReferenceDumper
}
/**
* Outputs a single config reference line
* Outputs a single config reference line.
*
* @param string $text
* @param int $indent

View File

@ -125,7 +125,7 @@ class YamlReferenceDumper
if ($info = $node->getInfo()) {
$this->writeLine('');
// indenting multi-line info
$info = str_replace("\n", sprintf("\n%".($depth * 4)."s# ", ' '), $info);
$info = str_replace("\n", sprintf("\n%".($depth * 4).'s# ', ' '), $info);
$this->writeLine('# '.$info, $depth * 4);
}
@ -160,7 +160,7 @@ class YamlReferenceDumper
}
/**
* Outputs a single config reference line
* Outputs a single config reference line.
*
* @param string $text
* @param int $indent

View File

@ -19,19 +19,19 @@ namespace Symfony\Component\Console\Event;
class ConsoleCommandEvent extends ConsoleEvent
{
/**
* The return code for skipped commands, this will also be passed into the terminate event
* The return code for skipped commands, this will also be passed into the terminate event.
*/
const RETURN_CODE_DISABLED = 113;
/**
* Indicates if the command should be run or skipped
* Indicates if the command should be run or skipped.
*
* @var bool
*/
private $commandShouldRun = true;
/**
* Disables the command, so it won't be run
* Disables the command, so it won't be run.
*
* @return bool
*/
@ -41,7 +41,7 @@ class ConsoleCommandEvent extends ConsoleEvent
}
/**
* Enables the command
* Enables the command.
*
* @return bool
*/
@ -51,7 +51,7 @@ class ConsoleCommandEvent extends ConsoleEvent
}
/**
* Returns true if the command is runnable, false otherwise
* Returns true if the command is runnable, false otherwise.
*
* @return bool
*/

View File

@ -25,7 +25,7 @@ class DebugFormatterHelper extends Helper
private $count = -1;
/**
* Starts a debug formatting session
* Starts a debug formatting session.
*
* @param string $id The id of the formatting session
* @param string $message The message to display
@ -41,7 +41,7 @@ class DebugFormatterHelper extends Helper
}
/**
* Adds progress to a formatting session
* Adds progress to a formatting session.
*
* @param string $id The id of the formatting session
* @param string $buffer The message to display
@ -61,7 +61,7 @@ class DebugFormatterHelper extends Helper
unset($this->started[$id]['out']);
}
if (!isset($this->started[$id]['err'])) {
$message .= sprintf("%s<bg=red;fg=white> %s </> ", $this->getBorder($id), $errorPrefix);
$message .= sprintf('%s<bg=red;fg=white> %s </> ', $this->getBorder($id), $errorPrefix);
$this->started[$id]['err'] = true;
}
@ -72,7 +72,7 @@ class DebugFormatterHelper extends Helper
unset($this->started[$id]['err']);
}
if (!isset($this->started[$id]['out'])) {
$message .= sprintf("%s<bg=green;fg=white> %s </> ", $this->getBorder($id), $prefix);
$message .= sprintf('%s<bg=green;fg=white> %s </> ', $this->getBorder($id), $prefix);
$this->started[$id]['out'] = true;
}
@ -83,7 +83,7 @@ class DebugFormatterHelper extends Helper
}
/**
* Stops a formatting session
* Stops a formatting session.
*
* @param string $id The id of the formatting session
* @param string $message The message to display

View File

@ -247,7 +247,7 @@ class Table
}
$markup = $this->style->getCrossingChar();
for ($column = 0; $column < $count; $column++) {
for ($column = 0; $column < $count; ++$column) {
$markup .= str_repeat($this->style->getHorizontalBorderChar(), $this->columnWidths[$column]).$this->style->getCrossingChar();
}
@ -340,7 +340,7 @@ class Table
private function buildTableRows($rows)
{
$unmergedRows = array();
for ($rowKey = 0; $rowKey < count($rows); $rowKey++) {
for ($rowKey = 0; $rowKey < count($rows); ++$rowKey) {
$rows = $this->fillNextRows($rows, $rowKey);
// Remove any new line breaks and replace it with a new line

View File

@ -18,9 +18,10 @@ use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Output\ConsoleOutputInterface;
/**
* PSR-3 compliant console logger
* PSR-3 compliant console logger.
*
* @author Kévin Dunglas <dunglas@gmail.com>
*
* @link http://www.php-fig.org/psr/psr-3/
*/
class ConsoleLogger extends AbstractLogger
@ -93,7 +94,7 @@ class ConsoleLogger extends AbstractLogger
}
/**
* Interpolates context values into the message placeholders
* Interpolates context values into the message placeholders.
*
* @author PHP Framework Interoperability Group
*

View File

@ -23,8 +23,8 @@ class ConfirmationQuestion extends Question
/**
* Constructor.
*
* @param string $question The question to ask to the user
* @param bool $default The default answer to return, true or false
* @param string $question The question to ask to the user
* @param bool $default The default answer to return, true or false
* @param string $trueAnswerRegex A regex to match the "yes" answer
*/
public function __construct($question, $default = true, $trueAnswerRegex = '/^y/i')

View File

@ -16,7 +16,7 @@ use Symfony\Component\Console\Helper\ProgressBar;
use Symfony\Component\Console\Output\OutputInterface;
/**
* Decorates output to add console style guide helpers
* Decorates output to add console style guide helpers.
*
* @author Kevin Bond <kevinbond@gmail.com>
*/

View File

@ -14,7 +14,7 @@ namespace Symfony\Component\Console\Tests\Fixtures;
use Symfony\Component\Console\Output\BufferedOutput;
/**
* Dummy output
* Dummy output.
*
* @author Kévin Dunglas <dunglas@gmail.com>
*/

View File

@ -315,7 +315,7 @@ class ProgressBarTest extends \PHPUnit_Framework_TestCase
$bar = new ProgressBar($output = $this->getOutputStream(false), 200);
$bar->start();
for ($i = 0; $i < 200; $i++) {
for ($i = 0; $i < 200; ++$i) {
$bar->advance();
}
@ -384,7 +384,7 @@ class ProgressBarTest extends \PHPUnit_Framework_TestCase
$output->write("\n");
$bar3->start();
for ($i = 1; $i <= 3; $i++) {
for ($i = 1; $i <= 3; ++$i) {
// up two lines
$output->write("\033[2A");
if ($i <= 2) {

View File

@ -18,7 +18,7 @@ use Symfony\Component\Console\Tests\Fixtures\DummyOutput;
use Symfony\Component\Console\Output\OutputInterface;
/**
* Console logger test
* Console logger test.
*
* @author Kévin Dunglas <dunglas@gmail.com>
*/

View File

@ -78,7 +78,7 @@ class Specificity
/**
* Returns -1 if the object specificity is lower than the argument,
* 0 if they are equal, and 1 if the argument is lower
* 0 if they are equal, and 1 if the argument is lower.
*
* @param Specificity $specificity
*

View File

@ -1,5 +1,14 @@
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\DependencyInjection\Tests\Compiler;
use Symfony\Component\DependencyInjection\Compiler\AutoAliasServicePass;

View File

@ -1,5 +1,14 @@
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\DependencyInjection\Tests\Compiler;
use Symfony\Component\DependencyInjection\Compiler\MergeExtensionConfigurationPass;
@ -35,7 +44,7 @@ class MergeExtensionConfigurationPassTest extends \PHPUnit_Framework_TestCase
$provider = $this->getMock('Symfony\\Component\\ExpressionLanguage\\ExpressionFunctionProviderInterface');
$container = new ContainerBuilder(new ParameterBag());
$container->registerExtension($extension);
$container->prependExtensionConfig('foo', array('bar' => true ));
$container->prependExtensionConfig('foo', array('bar' => true));
$container->addExpressionLanguageProvider($provider);
$pass = new MergeExtensionConfigurationPass();

View File

@ -355,7 +355,7 @@ class Form extends Link implements \ArrayAccess
}
/**
* Disables validation
* Disables validation.
*
* @return self
*/

View File

@ -125,7 +125,7 @@ abstract class AbstractEventDispatcherTest extends \PHPUnit_Framework_TestCase
{
$invoked = 0;
$listener = function () use (&$invoked) {
$invoked++;
++$invoked;
};
$this->dispatcher->addListener('pre.foo', $listener);
$this->dispatcher->addListener('post.foo', $listener);

View File

@ -110,8 +110,8 @@ class TraceableEventDispatcherTest extends \PHPUnit_Framework_TestCase
$tdispatcher->addListener('foo', $listener1 = function () {; });
$tdispatcher->addListener('foo', $listener2 = function () {; });
$logger->expects($this->at(0))->method('debug')->with("Notified event \"foo\" to listener \"closure\".");
$logger->expects($this->at(1))->method('debug')->with("Notified event \"foo\" to listener \"closure\".");
$logger->expects($this->at(0))->method('debug')->with('Notified event "foo" to listener "closure".');
$logger->expects($this->at(1))->method('debug')->with('Notified event "foo" to listener "closure".');
$tdispatcher->dispatch('foo');
}
@ -125,9 +125,9 @@ class TraceableEventDispatcherTest extends \PHPUnit_Framework_TestCase
$tdispatcher->addListener('foo', $listener1 = function (Event $event) { $event->stopPropagation(); });
$tdispatcher->addListener('foo', $listener2 = function () {; });
$logger->expects($this->at(0))->method('debug')->with("Notified event \"foo\" to listener \"closure\".");
$logger->expects($this->at(1))->method('debug')->with("Listener \"closure\" stopped propagation of the event \"foo\".");
$logger->expects($this->at(2))->method('debug')->with("Listener \"closure\" was not called for event \"foo\".");
$logger->expects($this->at(0))->method('debug')->with('Notified event "foo" to listener "closure".');
$logger->expects($this->at(1))->method('debug')->with('Listener "closure" stopped propagation of the event "foo".');
$logger->expects($this->at(2))->method('debug')->with('Listener "closure" was not called for event "foo".');
$tdispatcher->dispatch('foo');
}

View File

@ -43,32 +43,32 @@ class Parser
'+' => array('precedence' => 500),
);
$this->binaryOperators = array(
'or' => array('precedence' => 10, 'associativity' => Parser::OPERATOR_LEFT),
'||' => array('precedence' => 10, 'associativity' => Parser::OPERATOR_LEFT),
'and' => array('precedence' => 15, 'associativity' => Parser::OPERATOR_LEFT),
'&&' => array('precedence' => 15, 'associativity' => Parser::OPERATOR_LEFT),
'|' => array('precedence' => 16, 'associativity' => Parser::OPERATOR_LEFT),
'^' => array('precedence' => 17, 'associativity' => Parser::OPERATOR_LEFT),
'&' => array('precedence' => 18, 'associativity' => Parser::OPERATOR_LEFT),
'==' => array('precedence' => 20, 'associativity' => Parser::OPERATOR_LEFT),
'===' => array('precedence' => 20, 'associativity' => Parser::OPERATOR_LEFT),
'!=' => array('precedence' => 20, 'associativity' => Parser::OPERATOR_LEFT),
'!==' => array('precedence' => 20, 'associativity' => Parser::OPERATOR_LEFT),
'<' => array('precedence' => 20, 'associativity' => Parser::OPERATOR_LEFT),
'>' => array('precedence' => 20, 'associativity' => Parser::OPERATOR_LEFT),
'>=' => array('precedence' => 20, 'associativity' => Parser::OPERATOR_LEFT),
'<=' => array('precedence' => 20, 'associativity' => Parser::OPERATOR_LEFT),
'not in' => array('precedence' => 20, 'associativity' => Parser::OPERATOR_LEFT),
'in' => array('precedence' => 20, 'associativity' => Parser::OPERATOR_LEFT),
'matches' => array('precedence' => 20, 'associativity' => Parser::OPERATOR_LEFT),
'..' => array('precedence' => 25, 'associativity' => Parser::OPERATOR_LEFT),
'+' => array('precedence' => 30, 'associativity' => Parser::OPERATOR_LEFT),
'-' => array('precedence' => 30, 'associativity' => Parser::OPERATOR_LEFT),
'~' => array('precedence' => 40, 'associativity' => Parser::OPERATOR_LEFT),
'*' => array('precedence' => 60, 'associativity' => Parser::OPERATOR_LEFT),
'/' => array('precedence' => 60, 'associativity' => Parser::OPERATOR_LEFT),
'%' => array('precedence' => 60, 'associativity' => Parser::OPERATOR_LEFT),
'**' => array('precedence' => 200, 'associativity' => Parser::OPERATOR_RIGHT),
'or' => array('precedence' => 10, 'associativity' => self::OPERATOR_LEFT),
'||' => array('precedence' => 10, 'associativity' => self::OPERATOR_LEFT),
'and' => array('precedence' => 15, 'associativity' => self::OPERATOR_LEFT),
'&&' => array('precedence' => 15, 'associativity' => self::OPERATOR_LEFT),
'|' => array('precedence' => 16, 'associativity' => self::OPERATOR_LEFT),
'^' => array('precedence' => 17, 'associativity' => self::OPERATOR_LEFT),
'&' => array('precedence' => 18, 'associativity' => self::OPERATOR_LEFT),
'==' => array('precedence' => 20, 'associativity' => self::OPERATOR_LEFT),
'===' => array('precedence' => 20, 'associativity' => self::OPERATOR_LEFT),
'!=' => array('precedence' => 20, 'associativity' => self::OPERATOR_LEFT),
'!==' => array('precedence' => 20, 'associativity' => self::OPERATOR_LEFT),
'<' => array('precedence' => 20, 'associativity' => self::OPERATOR_LEFT),
'>' => array('precedence' => 20, 'associativity' => self::OPERATOR_LEFT),
'>=' => array('precedence' => 20, 'associativity' => self::OPERATOR_LEFT),
'<=' => array('precedence' => 20, 'associativity' => self::OPERATOR_LEFT),
'not in' => array('precedence' => 20, 'associativity' => self::OPERATOR_LEFT),
'in' => array('precedence' => 20, 'associativity' => self::OPERATOR_LEFT),
'matches' => array('precedence' => 20, 'associativity' => self::OPERATOR_LEFT),
'..' => array('precedence' => 25, 'associativity' => self::OPERATOR_LEFT),
'+' => array('precedence' => 30, 'associativity' => self::OPERATOR_LEFT),
'-' => array('precedence' => 30, 'associativity' => self::OPERATOR_LEFT),
'~' => array('precedence' => 40, 'associativity' => self::OPERATOR_LEFT),
'*' => array('precedence' => 60, 'associativity' => self::OPERATOR_LEFT),
'/' => array('precedence' => 60, 'associativity' => self::OPERATOR_LEFT),
'%' => array('precedence' => 60, 'associativity' => self::OPERATOR_LEFT),
'**' => array('precedence' => 200, 'associativity' => self::OPERATOR_RIGHT),
);
}

View File

@ -71,7 +71,7 @@ class TokenStream
}
/**
* Checks if end of stream was reached
* Checks if end of stream was reached.
*
* @return bool
*/

View File

@ -12,7 +12,7 @@
namespace Symfony\Component\Filesystem\Exception;
/**
* Exception class thrown when a file couldn't be found
* Exception class thrown when a file couldn't be found.
*
* @author Fabien Potencier <fabien@symfony.com>
* @author Christian Gärtner <christiangaertner.film@googlemail.com>

View File

@ -19,7 +19,7 @@ namespace Symfony\Component\Filesystem\Exception;
interface IOExceptionInterface extends ExceptionInterface
{
/**
* Returns the associated path for the exception
* Returns the associated path for the exception.
*
* @return string The path.
*/

View File

@ -32,8 +32,9 @@ class LockHandler
private $handle;
/**
* @param string $name The lock name
* @param string|null $lockPath The directory to store the lock. Default values will use temporary directory
* @param string $name The lock name
* @param string|null $lockPath The directory to store the lock. Default values will use temporary directory
*
* @throws IOException If the lock directory could not be created or is not writable
*/
public function __construct($name, $lockPath = null)
@ -53,10 +54,12 @@ class LockHandler
}
/**
* Lock the resource
* Lock the resource.
*
* @param bool $blocking wait until the lock is released
*
* @return bool Returns true if the lock was acquired, false otherwise
*
* @param bool $blocking wait until the lock is released
* @return bool Returns true if the lock was acquired, false otherwise
* @throws IOException If the lock file could not be created or opened
*/
public function lock($blocking = false)
@ -98,7 +101,7 @@ class LockHandler
}
/**
* Release the resource
* Release the resource.
*/
public function release()
{

View File

@ -133,7 +133,7 @@ class CommandTest extends \PHPUnit_Framework_TestCase
public function testErrorHandler()
{
$cmd = Command::create();
$handler = function() { return 'error-handler'; };
$handler = function () { return 'error-handler'; };
$cmd->setErrorHandler($handler);
$this->assertSame($handler, $cmd->getErrorHandler());

View File

@ -336,8 +336,6 @@ class Button implements \IteratorAggregate, FormInterface
/**
* Unsupported method.
*
* @return null Always returns null
*/
public function getTransformationFailure()
{

View File

@ -48,9 +48,9 @@ interface ChoiceLoaderInterface
* The callable receives the choice as first and the array key as the second
* argument.
*
* @param string[] $values An array of choice values. Non-existing
* values in this array are ignored
* @param null|callable $value The callable generating the choice values
* @param string[] $values An array of choice values. Non-existing
* values in this array are ignored
* @param null|callable $value The callable generating the choice values
*
* @return array An array of choices
*/
@ -66,9 +66,9 @@ interface ChoiceLoaderInterface
* The callable receives the choice as first and the array key as the second
* argument.
*
* @param array $choices An array of choices. Non-existing choices in
* this array are ignored
* @param null|callable $value The callable generating the choice values
* @param array $choices An array of choices. Non-existing choices in
* this array are ignored
* @param null|callable $value The callable generating the choice values
*
* @return string[] An array of choice values
*/

View File

@ -19,14 +19,14 @@ namespace Symfony\Component\Form\ChoiceList\View;
class ChoiceGroupView implements \IteratorAggregate
{
/**
* The label of the group
* The label of the group.
*
* @var string
*/
public $label;
/**
* The choice views in the group
* The choice views in the group.
*
* @var ChoiceGroupView[]|ChoiceView[]
*/
@ -35,7 +35,7 @@ class ChoiceGroupView implements \IteratorAggregate
/**
* Creates a new choice group view.
*
* @param string $label The label of the group.
* @param string $label The label of the group.
* @param ChoiceGroupView[]|ChoiceView[] $choices The choice views in the
* group.
*/

View File

@ -13,7 +13,6 @@ namespace Symfony\Component\Form\Extension\Core\DataMapper;
use Symfony\Component\Form\ChoiceList\ChoiceListInterface;
use Symfony\Component\Form\DataMapperInterface;
use Symfony\Component\Form\Exception;
use Symfony\Component\Form\Exception\TransformationFailedException;
/**

View File

@ -13,7 +13,7 @@ namespace Symfony\Component\Form\Extension\Core\View;
@trigger_error('The '.__NAMESPACE__.'\ChoiceView class is deprecated since version 2.7 and will be removed in 3.0. Use Symfony\Component\Form\ChoiceList\View\ChoiceView instead.', E_USER_DEPRECATED);
/**
/*
* Represents a choice in templates.
*
* @author Bernhard Schussek <bschussek@gmail.com>

View File

@ -22,6 +22,7 @@ use Symfony\Component\Security\Csrf\CsrfTokenManagerInterface;
* is expected.
*
* @since 2.4
*
* @author Bernhard Schussek <bschussek@gmail.com>
*
* @deprecated since version 2.4, to be removed in 3.0.

View File

@ -18,6 +18,7 @@ use Symfony\Component\Security\Csrf\CsrfTokenManagerInterface;
* Adapter for using the new token generator with the old interface.
*
* @since 2.4
*
* @author Bernhard Schussek <bschussek@gmail.com>
*
* @deprecated since version 2.4, to be removed in 3.0.

View File

@ -18,6 +18,7 @@ use Symfony\Component\Form\AbstractExtension;
* Extension for collecting data of the forms on a page.
*
* @since 2.4
*
* @author Robert Schönthal <robert.schoenthal@gmail.com>
* @author Bernhard Schussek <bschussek@gmail.com>
*/

View File

@ -21,6 +21,7 @@ use Symfony\Component\Form\FormEvents;
* and {@link FormEvents::POST_SUBMIT} events.
*
* @since 2.4
*
* @author Bernhard Schussek <bschussek@gmail.com>
*/
class DataCollectorListener implements EventSubscriberInterface

View File

@ -21,6 +21,7 @@ use Symfony\Component\HttpKernel\DataCollector\DataCollector;
* Data collector for {@link FormInterface} instances.
*
* @since 2.4
*
* @author Robert Schönthal <robert.schoenthal@gmail.com>
* @author Bernhard Schussek <bschussek@gmail.com>
*/

View File

@ -19,6 +19,7 @@ use Symfony\Component\HttpKernel\DataCollector\DataCollectorInterface;
* Collects and structures information about forms.
*
* @since 2.4
*
* @author Bernhard Schussek <bschussek@gmail.com>
*/
interface FormDataCollectorInterface extends DataCollectorInterface

View File

@ -20,6 +20,7 @@ use Symfony\Component\Validator\ConstraintViolationInterface;
* Default implementation of {@link FormDataExtractorInterface}.
*
* @since 2.4
*
* @author Bernhard Schussek <bschussek@gmail.com>
*/
class FormDataExtractor implements FormDataExtractorInterface

View File

@ -18,6 +18,7 @@ use Symfony\Component\Form\FormView;
* Extracts arrays of information out of forms.
*
* @since 2.4
*
* @author Bernhard Schussek <bschussek@gmail.com>
*/
interface FormDataExtractorInterface

View File

@ -22,6 +22,7 @@ use Symfony\Component\Form\ResolvedFormTypeInterface;
* Proxy that invokes a data collector when creating a form and its view.
*
* @since 2.4
*
* @author Bernhard Schussek <bschussek@gmail.com>
*/
class ResolvedTypeDataCollectorProxy implements ResolvedFormTypeInterface

View File

@ -21,6 +21,7 @@ use Symfony\Component\Form\ResolvedFormTypeInterface;
* instances.
*
* @since 2.4
*
* @author Bernhard Schussek <bschussek@gmail.com>
*/
class ResolvedTypeFactoryDataCollectorProxy implements ResolvedFormTypeFactoryInterface

View File

@ -20,6 +20,7 @@ use Symfony\Component\Form\FormBuilderInterface;
* Type extension for collecting data of a form with this type.
*
* @since 2.4
*
* @author Robert Schönthal <robert.schoenthal@gmail.com>
* @author Bernhard Schussek <bschussek@gmail.com>
*/

View File

@ -50,7 +50,7 @@ class ValidatorExtension extends AbstractExtension
// the DIC, where the XML file is loaded automatically. Thus the following
// code must be kept synchronized with validation.xml
/** @var $metadata ClassMetadata */
/* @var $metadata ClassMetadata */
$metadata->addConstraint(new Form());
$metadata->addPropertyConstraint('children', new Valid());

View File

@ -87,7 +87,7 @@ class FormErrorIterator implements \RecursiveIterator, \SeekableIterator, \Array
if ($error instanceof FormError) {
$string .= 'ERROR: '.$error->getMessage()."\n";
} else {
/** @var $error FormErrorIterator */
/* @var $error FormErrorIterator */
$string .= $error->form->getName().":\n";
$string .= self::indent((string) $error);
}

View File

@ -1,4 +1,5 @@
<?php
/*
* This file is part of the Symfony package.
*

View File

@ -1,4 +1,5 @@
<?php
/*
* This file is part of the Symfony package.
*

View File

@ -15,6 +15,7 @@ use Symfony\Component\Validator\Validation;
/**
* @since 2.5.3
*
* @author Bernhard Schussek <bschussek@gmail.com>
* @group legacy
*/

View File

@ -20,8 +20,8 @@ use Symfony\Component\Form\Test\FormIntegrationTestCase as BaseFormIntegrationTe
abstract class FormIntegrationTestCase extends BaseFormIntegrationTestCase
{
/**
* {@inheritdoc}
*/
* {@inheritdoc}
*/
protected function setUp()
{
@trigger_error('The '.__CLASS__.' class is deprecated since version 2.3 and will be removed in 3.0. Use the Symfony\Component\Form\Test\FormIntegrationTestCase class instead.', E_USER_DEPRECATED);

View File

@ -20,8 +20,8 @@ use Symfony\Component\Form\Test\FormPerformanceTestCase as BaseFormPerformanceTe
abstract class FormPerformanceTestCase extends BaseFormPerformanceTestCase
{
/**
* {@inheritdoc}
*/
* {@inheritdoc}
*/
protected function setUp()
{
@trigger_error('The '.__CLASS__.' class is deprecated since version 2.3 and will be removed in 3.0. Use the Symfony\Component\Form\Test\FormPerformanceTestCase class instead.', E_USER_DEPRECATED);

View File

@ -308,6 +308,7 @@ class BinaryFileResponse extends Response
/**
* If this is set to true, the file will be unlinked after the request is send
* Note: If the X-Sendfile header is used, the deleteFileAfterSend setting will not be used.
*
* @param bool $shouldDelete
*
* @return BinaryFileResponse

View File

@ -1577,7 +1577,7 @@ class Request
// Content passed in parameter (test)
if (is_string($this->content)) {
$resource = fopen('php://temp','r+');
$resource = fopen('php://temp', 'r+');
fwrite($resource, $this->content);
rewind($resource);
@ -2001,7 +2001,7 @@ class Request
if (self::$requestFactory) {
$request = call_user_func(self::$requestFactory, $query, $request, $attributes, $cookies, $files, $server, $content);
if (!$request instanceof Request) {
if (!$request instanceof self) {
throw new \LogicException('The Request factory must return an instance of Symfony\Component\HttpFoundation\Request.');
}

View File

@ -108,7 +108,7 @@ class MemcacheSessionHandler implements \SessionHandlerInterface
}
/**
* Return a Memcache instance
* Return a Memcache instance.
*
* @return \Memcache
*/

View File

@ -114,7 +114,7 @@ class MemcachedSessionHandler implements \SessionHandlerInterface
}
/**
* Return a Memcached instance
* Return a Memcached instance.
*
* @return \Memcached
*/

View File

@ -177,7 +177,7 @@ class MongoDbSessionHandler implements \SessionHandlerInterface
}
/**
* Return a Mongo instance
* Return a Mongo instance.
*
* @return \Mongo
*/

View File

@ -51,7 +51,7 @@ class StreamedResponse extends Response
}
/**
* Factory method for chainability
* Factory method for chainability.
*
* @param callable|null $callback A valid PHP callback or null to set it later
* @param int $status The response status code

View File

@ -980,7 +980,7 @@ class RequestTest extends \PHPUnit_Framework_TestCase
public function testContentAsResource()
{
$resource = fopen('php://memory','r+');
$resource = fopen('php://memory', 'r+');
fwrite($resource, 'My other content');
rewind($resource);

View File

@ -205,7 +205,7 @@ class PdoSessionHandlerTest extends \PHPUnit_Framework_TestCase
}
/**
* Simulates session_regenerate_id(true) which will require an INSERT or UPDATE (replace)
* Simulates session_regenerate_id(true) which will require an INSERT or UPDATE (replace).
*/
public function testWriteDifferentSessionIdThanRead()
{

View File

@ -157,7 +157,7 @@ class ControllerResolver implements ControllerResolverInterface
}
/**
* Returns an instantiated controller
* Returns an instantiated controller.
*
* @param string $class A class name
*

View File

@ -54,7 +54,7 @@ class ValueExporter
return sprintf("[\n%s%s\n%s]", $indent, implode(sprintf(", \n%s", $indent), $a), str_repeat(' ', $depth - 1));
}
return sprintf("[%s]", implode(', ', $a));
return sprintf('[%s]', implode(', ', $a));
}
if (is_resource($value)) {

View File

@ -16,7 +16,7 @@ use Symfony\Component\HttpKernel\KernelEvents;
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
/**
* Adds configured formats to each request
* Adds configured formats to each request.
*
* @author Gildas Quemener <gildas.quemener@gmail.com>
*/
@ -36,7 +36,7 @@ class AddRequestFormatsListener implements EventSubscriberInterface
}
/**
* Adds request formats
* Adds request formats.
*
* @param GetResponseEvent $event
*/

View File

@ -17,7 +17,7 @@ use Symfony\Component\HttpKernel\KernelEvents;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
/**
* SurrogateListener adds a Surrogate-Control HTTP header when the Response needs to be parsed for Surrogates
* SurrogateListener adds a Surrogate-Control HTTP header when the Response needs to be parsed for Surrogates.
*
* @author Fabien Potencier <fabien@symfony.com>
*/

View File

@ -48,7 +48,7 @@ abstract class TestSessionListener implements EventSubscriberInterface
/**
* Checks if session was initialized and saves if current request is master
* Runs on 'kernel.response' in test environment
* Runs on 'kernel.response' in test environment.
*
* @param FilterResponseEvent $event
*/

View File

@ -45,7 +45,7 @@ class ResponseCacheStrategy implements ResponseCacheStrategyInterface
$this->maxAges[] = $response->getMaxAge();
}
$this->embeddedResponses++;
++$this->embeddedResponses;
}
/**

View File

@ -17,7 +17,7 @@ use Symfony\Component\HttpFoundation\Response;
interface SurrogateInterface
{
/**
* Returns surrogate name
* Returns surrogate name.
*
* @return string
*/

View File

@ -16,7 +16,7 @@ use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\KernelEvents;
/**
* Test AddRequestFormatsListener class
* Test AddRequestFormatsListener class.
*
* @author Gildas Quemener <gildas.quemener@gmail.com>
*/

View File

@ -25,7 +25,7 @@ use Symfony\Component\HttpKernel\EventListener\DebugHandlersListener;
use Symfony\Component\HttpKernel\KernelEvents;
/**
* DebugHandlersListenerTest
* DebugHandlersListenerTest.
*
* @author Nicolas Grekas <p@tchwork.com>
*/

View File

@ -19,7 +19,7 @@ use Symfony\Component\VarDumper\Dumper\DataDumperInterface;
use Symfony\Component\VarDumper\VarDumper;
/**
* DumpListenerTest
* DumpListenerTest.
*
* @author Nicolas Grekas <p@tchwork.com>
*/

View File

@ -44,7 +44,7 @@ class ProfilerListenerTest extends \PHPUnit_Framework_TestCase
->disableOriginalConstructor()
->getMock();
$subRequest = $this->getMockBuilder('Symfony\Component\HttpFoundation\Request')
$subRequest = $this->getMockBuilder('Symfony\Component\HttpFoundation\Request')
->disableOriginalConstructor()
->getMock();

View File

@ -722,7 +722,7 @@ EOF;
}
/**
* Returns a mock for the BundleInterface
* Returns a mock for the BundleInterface.
*
* @return BundleInterface
*/

View File

@ -43,7 +43,7 @@ class UriSignerTest extends \PHPUnit_Framework_TestCase
$signer = new UriSigner('foobar');
$this->assertSame(
"http://example.com/foo?baz=bay&foo=bar&_hash=rIOcC%2FF3DoEGo%2FvnESjSp7uU9zA9S%2F%2BOLhxgMexoPUM%3D",
'http://example.com/foo?baz=bay&foo=bar&_hash=rIOcC%2FF3DoEGo%2FvnESjSp7uU9zA9S%2F%2BOLhxgMexoPUM%3D',
$signer->sign('http://example.com/foo?foo=bar&baz=bay')
);
$this->assertTrue($signer->check($signer->sign('http://example.com/foo?foo=bar&baz=bay')));

View File

@ -54,7 +54,7 @@ abstract class AbstractPipes implements PipesInterface
}
/**
* Unblocks streams
* Unblocks streams.
*/
protected function unblock()
{

View File

@ -200,7 +200,7 @@ class UnixPipes extends AbstractPipes
}
/**
* Creates a new UnixPipes instance
* Creates a new UnixPipes instance.
*
* @param Process $process
* @param string|resource $input

View File

@ -173,7 +173,7 @@ class WindowsPipes extends AbstractPipes
}
/**
* Removes temporary files
* Removes temporary files.
*/
private function removeFiles()
{
@ -186,7 +186,7 @@ class WindowsPipes extends AbstractPipes
}
/**
* Writes input to stdin
* Writes input to stdin.
*
* @param bool $blocking
* @param bool $close

View File

@ -506,7 +506,7 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase
$process = $this->getProcess('echo foo');
$this->assertSame($process, $process->mustRun());
$this->assertEquals("foo".PHP_EOL, $process->getOutput());
$this->assertEquals('foo'.PHP_EOL, $process->getOutput());
}
public function testSuccessfulMustRunHasCorrectExitCode()
@ -541,7 +541,7 @@ abstract class AbstractProcessTest extends \PHPUnit_Framework_TestCase
$start = microtime(true);
$process->start();
$end = microtime(true);
$this->assertLessThan(0.2, $end-$start);
$this->assertLessThan(0.2, $end - $start);
$process->wait();
}

View File

@ -91,7 +91,7 @@ class ProcessFailedExceptionTest extends \PHPUnit_Framework_TestCase
/**
* Tests that ProcessFailedException does not extract information from
* process output if it was previously disabled
* process output if it was previously disabled.
*/
public function testDisabledOutputInFailedExceptionDoesNotPopulateOutput()
{

View File

@ -229,7 +229,7 @@ class PropertyAccessor implements PropertyAccessorInterface
// the final value of the path must not be validated
if ($i + 1 < $propertyPath->getLength() && !is_object($objectOrArray) && !is_array($objectOrArray)) {
throw new UnexpectedTypeException($objectOrArray, $propertyPath, $i+1);
throw new UnexpectedTypeException($objectOrArray, $propertyPath, $i + 1);
}
$propertyValues[] = &$propertyValue;

View File

@ -24,4 +24,4 @@ class TestClassIsWritable
{
$this->value = $value;
}
}
}

View File

@ -29,4 +29,4 @@ class TestClassSetValue
{
$this->value = $value;
}
}
}

View File

@ -458,7 +458,6 @@ class PropertyAccessorTest extends \PHPUnit_Framework_TestCase
array(new TestClassSetValue(array('a' => array('b' => 'old-value'))), 'value[a][b]', 'new-value'),
array(new \ArrayIterator(array('a' => array('b' => array('c' => 'old-value')))), '[a][b][c]', 'new-value'),
);
}
/**
@ -478,7 +477,6 @@ class PropertyAccessorTest extends \PHPUnit_Framework_TestCase
array(new TestClassIsWritable(new \ArrayIterator(array('a' => array('b' => 'old-value')))), 'value[a][b]', true),
array(new TestClassIsWritable(array('a' => array('b' => array('c' => new TestClassSetValue('old-value'))))), 'value[a][b][c].value', true),
);
}
/**
@ -488,5 +486,4 @@ class PropertyAccessorTest extends \PHPUnit_Framework_TestCase
{
$this->assertEquals($value, $this->propertyAccessor->isWritable($object, $path));
}
}
}

Some files were not shown because too many files have changed in this diff Show More