Merge branch '2.7' into 2.8
* 2.7: (22 commits) Tests and fix for issue in array model data in EntityType field with multiple=true [Form] Fixed PercentToLocalizedStringTransformer to accept both comma and dot as decimal separator, if possible removed useless PHPDoc [Form] Fix FormInterface::submit() annotation PdoSessionHandler: fix advisory lock for pgsql when session.sid_bits_per_character > 4 HttpCache does not consider ESI resources in HEAD requests Fix translation for "This field was not expected" [Routing] Enhance Route(Collection) docblocks Added improvement for accuracy in MoneyToLocalizedStringTransformer. Removed unused private property Use correct verb form in the pull request template Use PHP_MAXPATHLEN in Filesystem. Added null as explicit return type (?TokenInterface) [FrameworkBundle] Fix Routing\DelegatingLoader Render all line breaks according to the exception message [Form] Fix phpdoc [DI] remove confusing code [Form] Fixed GroupSequence with "constraints" option [Validator] Clarify UUID validator behavior [Filesystem] Fixed makePathRelative ...
This commit is contained in:
commit
d4cbc70c50
4
.github/PULL_REQUEST_TEMPLATE.md
vendored
4
.github/PULL_REQUEST_TEMPLATE.md
vendored
@ -2,9 +2,9 @@
|
||||
| ------------- | ---
|
||||
| Branch? | 3.4 or master / 2.7, 2.8 or 3.3 <!-- see comment below -->
|
||||
| Bug fix? | yes/no
|
||||
| New feature? | yes/no <!-- don't forget updating src/**/CHANGELOG.md files -->
|
||||
| New feature? | yes/no <!-- don't forget to update src/**/CHANGELOG.md files -->
|
||||
| BC breaks? | yes/no
|
||||
| Deprecations? | yes/no <!-- don't forget updating UPGRADE-*.md files -->
|
||||
| Deprecations? | yes/no <!-- don't forget to update UPGRADE-*.md files -->
|
||||
| Tests pass? | yes/no
|
||||
| Fixed tickets | #... <!-- #-prefixed issue number(s), if any -->
|
||||
| License | MIT
|
||||
|
@ -27,8 +27,6 @@ class ProxyCacheWarmer implements CacheWarmerInterface
|
||||
private $registry;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param ManagerRegistry $registry A ManagerRegistry instance
|
||||
*/
|
||||
public function __construct(ManagerRegistry $registry)
|
||||
|
@ -31,8 +31,6 @@ class ContainerAwareLoader extends Loader
|
||||
private $container;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param ContainerInterface $container A ContainerInterface instance
|
||||
*/
|
||||
public function __construct(ContainerInterface $container)
|
||||
|
@ -97,8 +97,6 @@ abstract class RegisterMappingsPass implements CompilerPassInterface
|
||||
private $aliasMap;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* The $managerParameters is an ordered list of container parameters that could provide the
|
||||
* name of the manager to register these namespaces and alias on. The first non-empty name
|
||||
* is used, the others skipped.
|
||||
|
@ -54,8 +54,6 @@ class DbalSessionHandler implements \SessionHandlerInterface
|
||||
private $timeCol = 'sess_time';
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param Connection $con A connection
|
||||
* @param string $tableName Table name
|
||||
*/
|
||||
|
@ -16,8 +16,6 @@ use Symfony\Component\Stopwatch\Stopwatch;
|
||||
use Doctrine\DBAL\Logging\SQLLogger;
|
||||
|
||||
/**
|
||||
* DbalLogger.
|
||||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
*/
|
||||
class DbalLogger implements SQLLogger
|
||||
@ -29,8 +27,6 @@ class DbalLogger implements SQLLogger
|
||||
protected $stopwatch;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param LoggerInterface $logger A LoggerInterface instance
|
||||
* @param Stopwatch $stopwatch A Stopwatch instance
|
||||
*/
|
||||
|
@ -1516,4 +1516,38 @@ class EntityTypeTest extends BaseTypeTest
|
||||
$this->assertEquals($collection, $form->getNormData());
|
||||
$this->assertSame(array(), $form->getViewData(), 'View data is always an array');
|
||||
}
|
||||
|
||||
public function testSetDataEmptyArraySubmitNullMultiple()
|
||||
{
|
||||
$emptyArray = array();
|
||||
$form = $this->factory->create(static::TESTED_TYPE, null, array(
|
||||
'em' => 'default',
|
||||
'class' => self::SINGLE_IDENT_CLASS,
|
||||
'multiple' => true,
|
||||
));
|
||||
$form->setData($emptyArray);
|
||||
$form->submit(null);
|
||||
$this->assertInternalType('array', $form->getData());
|
||||
$this->assertEquals(array(), $form->getData());
|
||||
$this->assertEquals(array(), $form->getNormData());
|
||||
$this->assertSame(array(), $form->getViewData(), 'View data is always an array');
|
||||
}
|
||||
|
||||
public function testSetDataNonEmptyArraySubmitNullMultiple()
|
||||
{
|
||||
$entity1 = new SingleIntIdEntity(1, 'Foo');
|
||||
$this->persist(array($entity1));
|
||||
$form = $this->factory->create(static::TESTED_TYPE, null, array(
|
||||
'em' => 'default',
|
||||
'class' => self::SINGLE_IDENT_CLASS,
|
||||
'multiple' => true,
|
||||
));
|
||||
$existing = array(0 => $entity1);
|
||||
$form->setData($existing);
|
||||
$form->submit(null);
|
||||
$this->assertInternalType('array', $form->getData());
|
||||
$this->assertEquals(array(), $form->getData());
|
||||
$this->assertEquals(array(), $form->getNormData());
|
||||
$this->assertSame(array(), $form->getViewData(), 'View data is always an array');
|
||||
}
|
||||
}
|
||||
|
@ -23,7 +23,7 @@
|
||||
"require-dev": {
|
||||
"symfony/stopwatch": "~2.2|~3.0.0",
|
||||
"symfony/dependency-injection": "~2.2|~3.0.0",
|
||||
"symfony/form": "^2.8.18|~3.2.5",
|
||||
"symfony/form": "^2.8.27|~3.3.10",
|
||||
"symfony/http-kernel": "~2.2|~3.0.0",
|
||||
"symfony/property-access": "~2.3|~3.0.0",
|
||||
"symfony/property-info": "~2.8|3.0",
|
||||
|
@ -56,8 +56,6 @@ class ConsoleHandler extends AbstractProcessingHandler implements EventSubscribe
|
||||
);
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param OutputInterface|null $output The console output to use (the handler remains disabled when passing null
|
||||
* until the output is set, e.g. by using console events)
|
||||
* @param bool $bubble Whether the messages that are handled can bubble up the stack
|
||||
|
@ -41,8 +41,6 @@ class ProxyDumper implements DumperInterface
|
||||
private $classGenerator;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param string $salt
|
||||
*/
|
||||
public function __construct($salt = '')
|
||||
|
@ -19,8 +19,6 @@ use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
|
||||
/**
|
||||
* MessageDataCollector.
|
||||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
* @author Clément JOBEILI <clement.jobeili@gmail.com>
|
||||
*
|
||||
@ -33,8 +31,6 @@ class MessageDataCollector extends DataCollector
|
||||
private $isSpool;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* We don't inject the message logger and mailer here
|
||||
* to avoid the creation of these objects when no emails are sent.
|
||||
*
|
||||
|
@ -26,8 +26,6 @@ class CodeExtension extends AbstractExtension
|
||||
private $charset;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param string $fileLinkFormat The format for links to source files
|
||||
* @param string $rootDir The project root directory
|
||||
* @param string $charset The charset
|
||||
|
@ -26,8 +26,6 @@ class HttpKernelExtension extends AbstractExtension
|
||||
private $handler;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param FragmentHandler $handler A FragmentHandler instance
|
||||
*/
|
||||
public function __construct(FragmentHandler $handler)
|
||||
|
@ -26,8 +26,6 @@ use Twig\Node\SetNode;
|
||||
use Twig\NodeVisitor\AbstractNodeVisitor;
|
||||
|
||||
/**
|
||||
* TranslationDefaultDomainNodeVisitor.
|
||||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
*/
|
||||
class TranslationDefaultDomainNodeVisitor extends AbstractNodeVisitor
|
||||
@ -37,9 +35,6 @@ class TranslationDefaultDomainNodeVisitor extends AbstractNodeVisitor
|
||||
*/
|
||||
private $scope;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->scope = new Scope();
|
||||
|
@ -25,8 +25,6 @@ class RouterCacheWarmer implements CacheWarmerInterface
|
||||
protected $router;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param RouterInterface $router A Router instance
|
||||
*/
|
||||
public function __construct(RouterInterface $router)
|
||||
|
@ -30,8 +30,6 @@ class TemplateFinder implements TemplateFinderInterface
|
||||
private $templates;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param KernelInterface $kernel A KernelInterface instance
|
||||
* @param TemplateNameParserInterface $parser A TemplateNameParserInterface instance
|
||||
* @param string $rootDir The directory where global templates can be stored
|
||||
|
@ -25,8 +25,6 @@ class TemplatePathsCacheWarmer extends CacheWarmer
|
||||
protected $locator;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param TemplateFinderInterface $finder A template finder
|
||||
* @param TemplateLocator $locator The template locator
|
||||
*/
|
||||
|
@ -22,8 +22,6 @@ use Symfony\Component\HttpKernel\Kernel;
|
||||
use Symfony\Component\HttpKernel\Bundle\Bundle;
|
||||
|
||||
/**
|
||||
* Application.
|
||||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
*/
|
||||
class Application extends BaseApplication
|
||||
@ -32,8 +30,6 @@ class Application extends BaseApplication
|
||||
private $commandsRegistered = false;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param KernelInterface $kernel A KernelInterface instance
|
||||
*/
|
||||
public function __construct(KernelInterface $kernel)
|
||||
|
@ -24,9 +24,6 @@ use Symfony\Component\Console\Helper\DescriptorHelper as BaseDescriptorHelper;
|
||||
*/
|
||||
class DescriptorHelper extends BaseDescriptorHelper
|
||||
{
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this
|
||||
|
@ -25,8 +25,6 @@ class ControllerNameParser
|
||||
protected $kernel;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param KernelInterface $kernel A KernelInterface instance
|
||||
*/
|
||||
public function __construct(KernelInterface $kernel)
|
||||
|
@ -17,8 +17,6 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
|
||||
|
||||
/**
|
||||
* ControllerResolver.
|
||||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
*/
|
||||
class ControllerResolver extends BaseControllerResolver
|
||||
@ -27,8 +25,6 @@ class ControllerResolver extends BaseControllerResolver
|
||||
protected $parser;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param ContainerInterface $container A ContainerInterface instance
|
||||
* @param ControllerNameParser $parser A ControllerNameParser instance
|
||||
* @param LoggerInterface $logger A LoggerInterface instance
|
||||
|
@ -29,8 +29,6 @@ abstract class HttpCache extends BaseHttpCache
|
||||
protected $kernel;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param HttpKernelInterface $kernel An HttpKernelInterface instance
|
||||
* @param string $cacheDir The cache directory (default used if null)
|
||||
*/
|
||||
|
@ -32,8 +32,6 @@ class DelegatingLoader extends BaseDelegatingLoader
|
||||
private $loading = false;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* Ability to pass a LoggerInterface instance as second argument will be removed in 3.0.
|
||||
*
|
||||
* @param ControllerNameParser $parser A ControllerNameParser instance
|
||||
@ -92,7 +90,7 @@ class DelegatingLoader extends BaseDelegatingLoader
|
||||
$this->loading = false;
|
||||
|
||||
foreach ($collection->all() as $route) {
|
||||
if (!$controller = $route->getDefault('_controller')) {
|
||||
if (!is_string($controller = $route->getDefault('_controller')) || !$controller) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -29,8 +29,6 @@ class Router extends BaseRouter implements WarmableInterface
|
||||
private $container;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param ContainerInterface $container A ContainerInterface instance
|
||||
* @param mixed $resource The main resource to load
|
||||
* @param array $options An array of options
|
||||
|
@ -26,8 +26,6 @@ use Symfony\Component\Templating\Asset\PathPackage as BasePathPackage;
|
||||
class PathPackage extends BasePathPackage
|
||||
{
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param Request $request The current request
|
||||
* @param string $version The version
|
||||
* @param string $format The version format
|
||||
|
@ -29,8 +29,6 @@ class Debugger implements DebuggerInterface
|
||||
protected $logger;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param LoggerInterface $logger A LoggerInterface instance
|
||||
*/
|
||||
public function __construct(LoggerInterface $logger = null)
|
||||
|
@ -25,8 +25,6 @@ class DelegatingEngine extends BaseDelegatingEngine implements EngineInterface
|
||||
protected $container;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param ContainerInterface $container The DI container
|
||||
* @param array $engineIds An array of engine Ids
|
||||
*/
|
||||
|
@ -25,8 +25,6 @@ class ActionsHelper extends Helper
|
||||
private $handler;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param FragmentHandler $handler A FragmentHandler instance
|
||||
*/
|
||||
public function __construct(FragmentHandler $handler)
|
||||
|
@ -14,8 +14,6 @@ namespace Symfony\Bundle\FrameworkBundle\Templating\Helper;
|
||||
use Symfony\Component\Templating\Helper\Helper;
|
||||
|
||||
/**
|
||||
* CodeHelper.
|
||||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
*/
|
||||
class CodeHelper extends Helper
|
||||
@ -25,8 +23,6 @@ class CodeHelper extends Helper
|
||||
protected $charset;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param string $fileLinkFormat The format for links to source files
|
||||
* @param string $rootDir The project root directory
|
||||
* @param string $charset The charset
|
||||
|
@ -26,8 +26,6 @@ class RequestHelper extends Helper
|
||||
protected $requestStack;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param Request|RequestStack $requestStack A RequestStack instance or a Request instance
|
||||
*
|
||||
* @deprecated since version 2.5, passing a Request instance is deprecated and support for it will be removed in 3.0.
|
||||
|
@ -24,8 +24,6 @@ class RouterHelper extends Helper
|
||||
protected $generator;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param UrlGeneratorInterface $router A Router instance
|
||||
*/
|
||||
public function __construct(UrlGeneratorInterface $router)
|
||||
|
@ -26,8 +26,6 @@ class SessionHelper extends Helper
|
||||
protected $requestStack;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param Request|RequestStack $requestStack A RequestStack instance or a Request instance
|
||||
*
|
||||
* @deprecated since version 2.5, passing a Request instance is deprecated and support for it will be removed in 3.0.
|
||||
|
@ -15,8 +15,6 @@ use Symfony\Component\Templating\Helper\Helper;
|
||||
use Symfony\Component\Translation\TranslatorInterface;
|
||||
|
||||
/**
|
||||
* TranslatorHelper.
|
||||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
*/
|
||||
class TranslatorHelper extends Helper
|
||||
@ -24,8 +22,6 @@ class TranslatorHelper extends Helper
|
||||
protected $translator;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param TranslatorInterface $translator A TranslatorInterface instance
|
||||
*/
|
||||
public function __construct(TranslatorInterface $translator)
|
||||
|
@ -26,8 +26,6 @@ class FilesystemLoader implements LoaderInterface
|
||||
protected $locator;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param FileLocatorInterface $locator A FileLocatorInterface instance
|
||||
*/
|
||||
public function __construct(FileLocatorInterface $locator)
|
||||
|
@ -27,8 +27,6 @@ class TemplateLocator implements FileLocatorInterface
|
||||
private $cacheHits = array();
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param FileLocatorInterface $locator A FileLocatorInterface instance
|
||||
* @param string $cacheDir The cache path
|
||||
*/
|
||||
|
@ -27,8 +27,6 @@ class PhpEngine extends BasePhpEngine implements EngineInterface
|
||||
protected $container;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param TemplateNameParserInterface $parser A TemplateNameParserInterface instance
|
||||
* @param ContainerInterface $container The DI container
|
||||
* @param LoaderInterface $loader A loader instance
|
||||
|
@ -28,8 +28,6 @@ class TemplateNameParser extends BaseTemplateNameParser
|
||||
protected $cache = array();
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param KernelInterface $kernel A KernelInterface instance
|
||||
*/
|
||||
public function __construct(KernelInterface $kernel)
|
||||
|
@ -26,8 +26,6 @@ class TimedPhpEngine extends PhpEngine
|
||||
protected $stopwatch;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param TemplateNameParserInterface $parser A TemplateNameParserInterface instance
|
||||
* @param ContainerInterface $container A ContainerInterface instance
|
||||
* @param LoaderInterface $loader A LoaderInterface instance
|
||||
|
@ -44,3 +44,7 @@ fragment_home:
|
||||
fragment_inlined:
|
||||
path: /fragment_inlined
|
||||
defaults: { _controller: TestBundle:Fragment:inlined }
|
||||
|
||||
array_controller:
|
||||
path: /array_controller
|
||||
defaults: { _controller: [ArrayController, someAction] }
|
||||
|
@ -46,8 +46,6 @@ class Translator extends BaseTranslator implements WarmableInterface
|
||||
private $resources = array();
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* Available options:
|
||||
*
|
||||
* * cache_dir: The cache directory (or null to disable caching)
|
||||
|
@ -44,8 +44,6 @@ class ConstraintValidatorFactory implements ConstraintValidatorFactoryInterface
|
||||
protected $validators;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param ContainerInterface $container The service container
|
||||
* @param array $validators An array of validators
|
||||
*/
|
||||
|
@ -20,8 +20,6 @@ use Symfony\Component\Security\Core\Role\RoleInterface;
|
||||
use Symfony\Component\Security\Http\Logout\LogoutUrlGenerator;
|
||||
|
||||
/**
|
||||
* SecurityDataCollector.
|
||||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
*/
|
||||
class SecurityDataCollector extends DataCollector
|
||||
@ -31,8 +29,6 @@ class SecurityDataCollector extends DataCollector
|
||||
private $logoutUrlGenerator;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param TokenStorageInterface|null $tokenStorage
|
||||
* @param RoleHierarchyInterface|null $roleHierarchy
|
||||
* @param LogoutUrlGenerator|null $logoutUrlGenerator
|
||||
|
@ -37,8 +37,6 @@ class MainConfiguration implements ConfigurationInterface
|
||||
private $userProviderFactories;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param array $factories
|
||||
* @param array $userProviderFactories
|
||||
*/
|
||||
|
@ -27,8 +27,6 @@ class LogoutUrlHelper extends Helper
|
||||
private $generator;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param ContainerInterface|LogoutUrlGenerator $generator A ContainerInterface or LogoutUrlGenerator instance
|
||||
* @param UrlGeneratorInterface|null $router The router service
|
||||
* @param TokenStorageInterface|null $tokenStorage The token storage service
|
||||
|
@ -33,11 +33,9 @@ class TemplateCacheCacheWarmer implements CacheWarmerInterface
|
||||
private $paths;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param ContainerInterface $container The dependency injection container
|
||||
* @param TemplateFinderInterface $finder The template paths cache warmer
|
||||
* @param array $paths Additional twig paths to warm
|
||||
* @param ContainerInterface $container The dependency injection container
|
||||
* @param TemplateFinderInterface|null $finder The template paths cache warmer
|
||||
* @param array $paths Additional twig paths to warm
|
||||
*/
|
||||
public function __construct(ContainerInterface $container, TemplateFinderInterface $finder = null, array $paths = array())
|
||||
{
|
||||
|
@ -29,8 +29,6 @@ class FilesystemLoader extends BaseFilesystemLoader
|
||||
protected $parser;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param FileLocatorInterface $locator A FileLocatorInterface instance
|
||||
* @param TemplateNameParserInterface $parser A TemplateNameParserInterface instance
|
||||
*/
|
||||
|
@ -22,8 +22,6 @@ use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
|
||||
use Twig\Environment;
|
||||
|
||||
/**
|
||||
* ProfilerController.
|
||||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
*/
|
||||
class ProfilerController
|
||||
@ -36,8 +34,6 @@ class ProfilerController
|
||||
private $toolbarPosition;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param UrlGeneratorInterface $generator The URL Generator
|
||||
* @param Profiler $profiler The profiler
|
||||
* @param Environment $twig The twig environment
|
||||
|
@ -45,8 +45,6 @@ abstract class Client
|
||||
private $isMainRequest = true;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param array $server The server parameters (equivalent of $_SERVER)
|
||||
* @param History $history A History instance to store the browser history
|
||||
* @param CookieJar $cookieJar A CookieJar instance to store the cookies
|
||||
|
@ -12,8 +12,6 @@
|
||||
namespace Symfony\Component\BrowserKit;
|
||||
|
||||
/**
|
||||
* Request object.
|
||||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
*/
|
||||
class Request
|
||||
@ -27,8 +25,6 @@ class Request
|
||||
protected $content;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param string $uri The request URI
|
||||
* @param string $method The HTTP method request
|
||||
* @param array $parameters The request parameters
|
||||
|
@ -12,8 +12,6 @@
|
||||
namespace Symfony\Component\BrowserKit;
|
||||
|
||||
/**
|
||||
* Response object.
|
||||
*
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
*/
|
||||
class Response
|
||||
@ -23,8 +21,6 @@ class Response
|
||||
protected $headers;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* The headers array is a set of key/value pairs. If a header is present multiple times
|
||||
* then the value is an array of all the values.
|
||||
*
|
||||
|
@ -57,8 +57,6 @@ class ApcClassLoader
|
||||
protected $decorated;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param string $prefix The APC namespace prefix to use
|
||||
* @param object $decorated A class loader object that implements the findFile() method
|
||||
*
|
||||
|
@ -68,8 +68,6 @@ class ApcUniversalClassLoader extends UniversalClassLoader
|
||||
private $prefix;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param string $prefix A prefix to create a namespace in APC
|
||||
*
|
||||
* @throws \RuntimeException
|
||||
|
@ -31,8 +31,6 @@ class DebugClassLoader
|
||||
private $classFinder;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param object $classFinder
|
||||
*/
|
||||
public function __construct($classFinder)
|
||||
|
@ -21,8 +21,6 @@ class MapClassLoader
|
||||
private $map = array();
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param array $map A map where keys are classes and values the absolute file path
|
||||
*/
|
||||
public function __construct(array $map)
|
||||
|
@ -58,8 +58,6 @@ class WinCacheClassLoader
|
||||
protected $decorated;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param string $prefix The WinCache namespace prefix to use
|
||||
* @param object $decorated A class loader object that implements the findFile() method
|
||||
*
|
||||
|
@ -58,8 +58,6 @@ class XcacheClassLoader
|
||||
private $decorated;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param string $prefix The XCache namespace prefix to use
|
||||
* @param object $decorated A class loader object that implements the findFile() method
|
||||
*
|
||||
|
@ -33,8 +33,6 @@ abstract class BaseNode implements NodeInterface
|
||||
protected $attributes = array();
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param string $name The name of the node
|
||||
* @param NodeInterface $parent The parent of this node
|
||||
*
|
||||
|
@ -26,8 +26,6 @@ class ExprBuilder
|
||||
public $thenPart;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param NodeDefinition $node The related node
|
||||
*/
|
||||
public function __construct(NodeDefinition $node)
|
||||
|
@ -23,8 +23,6 @@ class MergeBuilder
|
||||
public $allowOverwrite = true;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param NodeDefinition $node The related node
|
||||
*/
|
||||
public function __construct(NodeDefinition $node)
|
||||
|
@ -21,9 +21,6 @@ class NodeBuilder implements NodeParentInterface
|
||||
protected $parent;
|
||||
protected $nodeMapping;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->nodeMapping = array(
|
||||
|
@ -40,8 +40,6 @@ abstract class NodeDefinition implements NodeParentInterface
|
||||
protected $attributes = array();
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param string $name The name of the node
|
||||
* @param NodeParentInterface|null $parent The parent
|
||||
*/
|
||||
|
@ -23,8 +23,6 @@ class NormalizationBuilder
|
||||
public $remappings = array();
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param NodeDefinition $node The related node
|
||||
*/
|
||||
public function __construct(NodeDefinition $node)
|
||||
|
@ -22,8 +22,6 @@ class ValidationBuilder
|
||||
public $rules = array();
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param NodeDefinition $node The related node
|
||||
*/
|
||||
public function __construct(NodeDefinition $node)
|
||||
|
@ -21,8 +21,6 @@ class FileLocator implements FileLocatorInterface
|
||||
protected $paths;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param string|array $paths A path or an array of paths where to look for resources
|
||||
*/
|
||||
public function __construct($paths = array())
|
||||
|
@ -24,8 +24,6 @@ use Symfony\Component\Config\Exception\FileLoaderLoadException;
|
||||
class DelegatingLoader extends Loader
|
||||
{
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param LoaderResolverInterface $resolver A LoaderResolverInterface instance
|
||||
*/
|
||||
public function __construct(LoaderResolverInterface $resolver)
|
||||
|
@ -35,8 +35,6 @@ abstract class FileLoader extends Loader
|
||||
private $currentDir;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param FileLocatorInterface $locator A FileLocatorInterface instance
|
||||
*/
|
||||
public function __construct(FileLocatorInterface $locator)
|
||||
|
@ -27,8 +27,6 @@ class LoaderResolver implements LoaderResolverInterface
|
||||
private $loaders = array();
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param LoaderInterface[] $loaders An array of loaders
|
||||
*/
|
||||
public function __construct(array $loaders = array())
|
||||
|
@ -22,8 +22,6 @@ class DirectoryResource implements SelfCheckingResourceInterface, \Serializable
|
||||
private $pattern;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param string $resource The file path to the resource
|
||||
* @param string|null $pattern A pattern to restrict monitored files
|
||||
*/
|
||||
|
@ -26,8 +26,6 @@ class FileExistenceResource implements SelfCheckingResourceInterface, \Serializa
|
||||
private $exists;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param string $resource The file path to the resource
|
||||
*/
|
||||
public function __construct($resource)
|
||||
|
@ -26,8 +26,6 @@ class FileResource implements SelfCheckingResourceInterface, \Serializable
|
||||
private $resource;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param string $resource The file path to the resource
|
||||
*/
|
||||
public function __construct($resource)
|
||||
|
@ -78,8 +78,6 @@ class Application
|
||||
private $initialized;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param string $name The name of the application
|
||||
* @param string $version The version of the application
|
||||
*/
|
||||
@ -684,7 +682,7 @@ class Application
|
||||
$width = 1 << 31;
|
||||
}
|
||||
$lines = array();
|
||||
foreach (preg_split('/\r?\n/', $e->getMessage()) as $line) {
|
||||
foreach (preg_split('/\r?\n/', trim($e->getMessage())) as $line) {
|
||||
foreach ($this->splitStringByWidth($line, $width - 4) as $line) {
|
||||
// pre-format lines to get the right string length
|
||||
$lineLength = Helper::strlen($line) + 4;
|
||||
@ -1139,9 +1137,8 @@ class Application
|
||||
$lines[] = str_pad($line, $width);
|
||||
$line = $char;
|
||||
}
|
||||
if ('' !== $line) {
|
||||
$lines[] = count($lines) ? str_pad($line, $width) : $line;
|
||||
}
|
||||
|
||||
$lines[] = count($lines) ? str_pad($line, $width) : $line;
|
||||
|
||||
mb_convert_variables($encoding, 'utf8', $lines);
|
||||
|
||||
|
@ -48,8 +48,6 @@ class Command
|
||||
private $helperSet;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param string|null $name The name of the command; passing null means it must be set in configure()
|
||||
*
|
||||
* @throws LogicException When the command name is empty
|
||||
|
@ -50,8 +50,6 @@ class ApplicationDescription
|
||||
private $aliases;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param Application $application
|
||||
* @param string|null $namespace
|
||||
*/
|
||||
|
@ -29,8 +29,6 @@ class OutputFormatterStyleStack
|
||||
private $emptyStyle;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param OutputFormatterStyleInterface|null $emptyStyle
|
||||
*/
|
||||
public function __construct(OutputFormatterStyleInterface $emptyStyle = null)
|
||||
|
@ -31,9 +31,6 @@ class DescriptorHelper extends Helper
|
||||
*/
|
||||
private $descriptors = array();
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this
|
||||
|
@ -28,8 +28,6 @@ class HelperSet implements \IteratorAggregate
|
||||
private $command;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param Helper[] $helpers An array of helper
|
||||
*/
|
||||
public function __construct(array $helpers = array())
|
||||
|
@ -50,8 +50,6 @@ class ProgressBar
|
||||
private static $formats;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param OutputInterface $output An OutputInterface instance
|
||||
* @param int $max Maximum steps (0 if unknown)
|
||||
*/
|
||||
|
@ -44,8 +44,6 @@ class ArgvInput extends Input
|
||||
private $parsed;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param array|null $argv An array of parameters from the CLI (in the argv format)
|
||||
* @param InputDefinition|null $definition A InputDefinition instance
|
||||
*/
|
||||
|
@ -28,8 +28,6 @@ class ArrayInput extends Input
|
||||
private $parameters;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param array $parameters An array of parameters
|
||||
* @param InputDefinition|null $definition A InputDefinition instance
|
||||
*/
|
||||
|
@ -36,8 +36,6 @@ abstract class Input implements InputInterface
|
||||
protected $interactive = true;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param InputDefinition|null $definition A InputDefinition instance
|
||||
*/
|
||||
public function __construct(InputDefinition $definition = null)
|
||||
|
@ -31,8 +31,6 @@ class InputArgument
|
||||
private $description;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param string $name The argument name
|
||||
* @param int $mode The argument mode: self::REQUIRED or self::OPTIONAL
|
||||
* @param string $description A description text
|
||||
|
@ -39,8 +39,6 @@ class InputDefinition
|
||||
private $shortcuts;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param array $definition An array of InputArgument and InputOption instance
|
||||
*/
|
||||
public function __construct(array $definition = array())
|
||||
|
@ -33,8 +33,6 @@ class InputOption
|
||||
private $description;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param string $name The option name
|
||||
* @param string|array $shortcut The shortcuts, can be null, a string of shortcuts delimited by | or an array of shortcuts
|
||||
* @param int $mode The option mode: One of the VALUE_* constants
|
||||
|
@ -28,8 +28,6 @@ class StringInput extends ArgvInput
|
||||
const REGEX_QUOTED_STRING = '(?:"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"|\'([^\'\\\\]*(?:\\\\.[^\'\\\\]*)*)\')';
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param string $input An array of parameters from the CLI (in the argv format)
|
||||
* @param InputDefinition $definition A InputDefinition instance
|
||||
*
|
||||
|
@ -34,8 +34,6 @@ class ConsoleOutput extends StreamOutput implements ConsoleOutputInterface
|
||||
private $stderr;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param int $verbosity The verbosity level (one of the VERBOSITY constants in OutputInterface)
|
||||
* @param bool|null $decorated Whether to decorate messages (null for auto-guessing)
|
||||
* @param OutputFormatterInterface|null $formatter Output formatter instance (null to use default OutputFormatter)
|
||||
|
@ -33,8 +33,6 @@ abstract class Output implements OutputInterface
|
||||
private $formatter;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param int $verbosity The verbosity level (one of the VERBOSITY constants in OutputInterface)
|
||||
* @param bool $decorated Whether to decorate messages
|
||||
* @param OutputFormatterInterface|null $formatter Output formatter instance (null to use default OutputFormatter)
|
||||
|
@ -33,8 +33,6 @@ class StreamOutput extends Output
|
||||
private $stream;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param resource $stream A stream resource
|
||||
* @param int $verbosity The verbosity level (one of the VERBOSITY constants in OutputInterface)
|
||||
* @param bool|null $decorated Whether to decorate messages (null for auto-guessing)
|
||||
|
@ -26,8 +26,6 @@ class ChoiceQuestion extends Question
|
||||
private $errorMessage = 'Value "%s" is invalid';
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param string $question The question to ask to the user
|
||||
* @param array $choices The list of available choices
|
||||
* @param mixed $default The default answer to return
|
||||
|
@ -21,8 +21,6 @@ class ConfirmationQuestion extends Question
|
||||
private $trueAnswerRegex;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @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
|
||||
|
@ -31,8 +31,6 @@ class Question
|
||||
private $normalizer;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param string $question The question to ask to the user
|
||||
* @param mixed $default The default answer to return if the user enters nothing
|
||||
*/
|
||||
|
@ -37,8 +37,6 @@ class Shell
|
||||
private $processIsolation = false;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* If there is no readline support for the current PHP executable
|
||||
* a \RuntimeException exception is thrown.
|
||||
*
|
||||
|
@ -35,8 +35,6 @@ class ApplicationTester
|
||||
private $statusCode;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param Application $application An Application instance to test
|
||||
*/
|
||||
public function __construct(Application $application)
|
||||
|
@ -30,8 +30,6 @@ class CommandTester
|
||||
private $statusCode;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param Command $command A Command instance to test
|
||||
*/
|
||||
public function __construct(Command $command)
|
||||
|
@ -612,6 +612,22 @@ class ApplicationTest extends TestCase
|
||||
$this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception_escapeslines.txt', $tester->getDisplay(true), '->renderException() escapes lines containing formatting');
|
||||
}
|
||||
|
||||
public function testRenderExceptionLineBreaks()
|
||||
{
|
||||
$application = $this->getMockBuilder('Symfony\Component\Console\Application')->setMethods(array('getTerminalWidth'))->getMock();
|
||||
$application->setAutoExit(false);
|
||||
$application->expects($this->any())
|
||||
->method('getTerminalWidth')
|
||||
->will($this->returnValue(120));
|
||||
$application->register('foo')->setCode(function () {
|
||||
throw new \InvalidArgumentException("\n\nline 1 with extra spaces \nline 2\n\nline 4\n");
|
||||
});
|
||||
$tester = new ApplicationTester($application);
|
||||
|
||||
$tester->run(array('command' => 'foo'), array('decorated' => false));
|
||||
$this->assertStringEqualsFile(self::$fixturesPath.'/application_renderexception_linebreaks.txt', $tester->getDisplay(true), '->renderException() keep multiple line breaks');
|
||||
}
|
||||
|
||||
public function testRun()
|
||||
{
|
||||
$application = new Application();
|
||||
|
@ -0,0 +1,11 @@
|
||||
|
||||
|
||||
[InvalidArgumentException]
|
||||
line 1 with extra spaces
|
||||
line 2
|
||||
|
||||
line 4
|
||||
|
||||
|
||||
foo
|
||||
|
@ -45,8 +45,6 @@ class Specificity
|
||||
private $c;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param int $a
|
||||
* @param int $b
|
||||
* @param int $c
|
||||
|
@ -33,8 +33,6 @@ class Parser implements ParserInterface
|
||||
private $tokenizer;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param null|Tokenizer $tokenizer
|
||||
*/
|
||||
public function __construct(Tokenizer $tokenizer = null)
|
||||
|
@ -33,9 +33,6 @@ class Tokenizer
|
||||
*/
|
||||
private $handlers;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$patterns = new TokenizerPatterns();
|
||||
|
@ -83,9 +83,6 @@ class TokenizerPatterns
|
||||
*/
|
||||
private $quotedStringPattern;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->unicodeEscapePattern = '\\\\([0-9a-f]{1,6})(?:\r\n|[ \n\r\t\f])?';
|
||||
|
@ -29,8 +29,6 @@ use Symfony\Component\CssSelector\XPath\XPathExpr;
|
||||
class HtmlExtension extends AbstractExtension
|
||||
{
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param Translator $translator
|
||||
*/
|
||||
public function __construct(Translator $translator)
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user