Skip to content

Commit

Permalink
Merge branch '4.0'
Browse files Browse the repository at this point in the history
* 4.0: (42 commits)
  fix merge
  Remove some unused variables and properties
  [appveyor] disable memory limit on composer up
  [HttpFoundation] don't prefix cookies with "Set-Cookie:"
  Remove some unused variables and properties
  [HttpFoundation] Fixed default user-agent (3.X -> 4.X)
  Fix debug:form definition
  Remove some unused variables, properties and methods
  fix some edge cases with indented blocks
  [ExpressionLanguage] Fix parse error on 5.3
  [HttpKernel] remove noisy frame in controller stack traces
  [DI] Force root-namespace for function calls in the dumper container
  [DI] Fix circular-aliases message
  register system cache clearer only if it's used
  doc : Namespace prefix must end with a "\"
  [ExpressionLanguage] throw an SyntaxError instead of letting a undefined index notice
  Prevent a loop in aliases within the `findDefinition` method
  [HttpKernel] Disable inlining on PHP 5
  Ensure that inlined services with parameterized class name can be dumped
  [DI] Fix non-string class handling in PhpDumper
  ...
  • Loading branch information
nicolas-grekas committed Dec 8, 2017
2 parents ca2b083 + dfeede2 commit a4f041e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 11 deletions.
3 changes: 1 addition & 2 deletions DependencyInjection/FormPass.php
Expand Up @@ -18,7 +18,6 @@
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
use Symfony\Component\DependencyInjection\Reference;
use Symfony\Component\Form\Command\DebugCommand;

/**
* Adds all services with the tags "form.type", "form.type_extension" and
Expand All @@ -36,7 +35,7 @@ class FormPass implements CompilerPassInterface
private $formTypeGuesserTag;
private $formDebugCommandService;

public function __construct(string $formExtensionService = 'form.extension', string $formTypeTag = 'form.type', string $formTypeExtensionTag = 'form.type_extension', string $formTypeGuesserTag = 'form.type_guesser', string $formDebugCommandService = DebugCommand::class)
public function __construct(string $formExtensionService = 'form.extension', string $formTypeTag = 'form.type', string $formTypeExtensionTag = 'form.type_extension', string $formTypeGuesserTag = 'form.type_guesser', string $formDebugCommandService = 'console.command.form_debug')
{
$this->formExtensionService = $formExtensionService;
$this->formTypeTag = $formTypeTag;
Expand Down
Expand Up @@ -23,20 +23,17 @@
class DateIntervalToStringTransformer implements DataTransformerInterface
{
private $format;
private $parseSigned;

/**
* Transforms a \DateInterval instance to a string.
*
* @see \DateInterval::format() for supported formats
*
* @param string $format The date format
* @param bool $parseSigned Whether to parse as a signed interval
* @param string $format The date format
*/
public function __construct(string $format = 'P%yY%mM%dDT%hH%iM%sS', bool $parseSigned = false)
public function __construct(string $format = 'P%yY%mM%dDT%hH%iM%sS')
{
$this->format = $format;
$this->parseSigned = $parseSigned;
}

/**
Expand Down
7 changes: 3 additions & 4 deletions Tests/DependencyInjection/FormPassTest.php
Expand Up @@ -14,7 +14,6 @@
use PHPUnit\Framework\TestCase;
use Symfony\Component\DependencyInjection\Argument\IteratorArgument;
use Symfony\Component\DependencyInjection\Argument\ServiceClosureArgument;
use Symfony\Component\Form\Command\DebugCommand;
use Symfony\Component\Form\DependencyInjection\FormPass;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;
Expand Down Expand Up @@ -43,7 +42,7 @@ public function testDoNothingIfDebugCommandNotLoaded()

$container->compile();

$this->assertFalse($container->hasDefinition(DebugCommand::class));
$this->assertFalse($container->hasDefinition('console.command.form_debug'));
}

public function testAddTaggedTypes()
Expand Down Expand Up @@ -72,13 +71,13 @@ public function testAddTaggedTypesToDebugCommand()
$container = $this->createContainerBuilder();

$container->setDefinition('form.extension', $this->createExtensionDefinition());
$container->setDefinition(DebugCommand::class, $this->createDebugCommandDefinition());
$container->setDefinition('console.command.form_debug', $this->createDebugCommandDefinition());
$container->register('my.type1', __CLASS__.'_Type1')->addTag('form.type')->setPublic(true);
$container->register('my.type2', __CLASS__.'_Type2')->addTag('form.type')->setPublic(true);

$container->compile();

$cmdDefinition = $container->getDefinition(DebugCommand::class);
$cmdDefinition = $container->getDefinition('console.command.form_debug');

$this->assertEquals(
array(
Expand Down

0 comments on commit a4f041e

Please sign in to comment.