This commit is contained in:
Nicolas Grekas 2018-05-16 16:41:07 +02:00
parent 205b097802
commit 71a1e29c82
11 changed files with 16 additions and 17 deletions

View File

@ -60,8 +60,8 @@ class DoctrineOrmTypeGuesser implements FormTypeGuesserInterface
case Type::DATETIMETZ:
case 'vardatetime':
return new TypeGuess('Symfony\Component\Form\Extension\Core\Type\DateTimeType', array(), Guess::HIGH_CONFIDENCE);
case 'datetime_immutable';
case 'datetimetz_immutable';
case 'datetime_immutable':
case 'datetimetz_immutable':
return new TypeGuess('Symfony\Component\Form\Extension\Core\Type\DateTimeType', array('input' => 'datetime_immutable'), Guess::HIGH_CONFIDENCE);
case 'dateinterval':
return new TypeGuess('Symfony\Component\Form\Extension\Core\Type\DateIntervalType', array(), Guess::HIGH_CONFIDENCE);

View File

@ -14,7 +14,6 @@ namespace Symfony\Bundle\TwigBundle\DependencyInjection\Compiler;
use Symfony\Component\DependencyInjection\Compiler\PriorityTaggedServiceTrait;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\Reference;
/**
* Adds tagged twig.extension services to twig service.

View File

@ -199,7 +199,7 @@ class ControllerResolver implements ControllerResolverInterface
{
$methods = get_class_methods($classOrObject);
return array_filter($methods, function(string $method) {
return array_filter($methods, function (string $method) {
return 0 !== strncmp($method, '__', 2);
});
}

View File

@ -10,6 +10,7 @@
*/
namespace Symfony\Component\Messenger\Transport\Serialization;
use Symfony\Component\Messenger\Envelope;
/**

View File

@ -13,7 +13,6 @@ namespace Symfony\Component\Routing\Loader;
use Doctrine\Common\Annotations\Reader;
use Symfony\Component\Config\Resource\FileResource;
use Symfony\Component\Routing\Annotation\Route as RouteAnnotation;
use Symfony\Component\Routing\Route;
use Symfony\Component\Routing\RouteCollection;
use Symfony\Component\Config\Loader\LoaderInterface;

View File

@ -473,7 +473,7 @@ EOF;
$code .= $this->indent($this->compileStaticPrefixCollection($route, $state, $prefixLen + strlen($prefix)));
$code .= "\n .')'";
$state->regex .= ')';
$state->markTail += 1;
++$state->markTail;
continue;
}

View File

@ -89,9 +89,9 @@ class PhpGeneratorDumperTest extends TestCase
$this->routeCollection->add('test.en', (new Route('/testing/is/fun'))->setDefault('_locale', 'en')->setDefault('_canonical_route', 'test'));
$this->routeCollection->add('test.nl', (new Route('/testen/is/leuk'))->setDefault('_locale', 'nl')->setDefault('_canonical_route', 'test'));
$code = $this->generatorDumper->dump([
$code = $this->generatorDumper->dump(array(
'class' => 'LocalizedProjectUrlGenerator',
]);
));
file_put_contents($this->testTmpFilepath, $code);
include $this->testTmpFilepath;
@ -99,7 +99,7 @@ class PhpGeneratorDumperTest extends TestCase
$projectUrlGenerator = new \LocalizedProjectUrlGenerator($context, null, 'en');
$urlWithDefaultLocale = $projectUrlGenerator->generate('test');
$urlWithSpecifiedLocale = $projectUrlGenerator->generate('test', ['_locale' => 'nl']);
$urlWithSpecifiedLocale = $projectUrlGenerator->generate('test', array('_locale' => 'nl'));
$context->setParameter('_locale', 'en');
$urlWithEnglishContext = $projectUrlGenerator->generate('test');
$context->setParameter('_locale', 'nl');

View File

@ -46,7 +46,9 @@ class AnnotationClassLoaderTest extends AbstractAnnotationLoaderTest
{
$reader = new AnnotationReader();
$this->loader = new class($reader) extends AnnotationClassLoader {
protected function configureRoute(Route $route, \ReflectionClass $class, \ReflectionMethod $method, $annot) {}
protected function configureRoute(Route $route, \ReflectionClass $class, \ReflectionMethod $method, $annot)
{
}
};
AnnotationRegistry::registerLoader('class_exists');
}
@ -194,7 +196,9 @@ class AnnotationClassLoaderTest extends AbstractAnnotationLoaderTest
->will($this->returnValue(array()))
;
$loader = new class($reader) extends AnnotationClassLoader {
protected function configureRoute(Route $route, \ReflectionClass $class, \ReflectionMethod $method, $annot) {}
protected function configureRoute(Route $route, \ReflectionClass $class, \ReflectionMethod $method, $annot)
{
}
};
$routeCollection = $loader->load('Symfony\Component\Routing\Tests\Fixtures\AnnotatedClasses\BazClass');

View File

@ -420,7 +420,6 @@ class XmlFileLoaderTest extends TestCase
$route = $routeCollection->get('baz_route');
$this->assertSame('AppBundle:Baz:view', $route->getDefault('_controller'));
}
public function testImportRouteWithNamePrefix()

View File

@ -28,7 +28,7 @@ class ClassDiscriminatorMappingTest extends TestCase
));
$this->assertEquals(AbstractDummyFirstChild::class, $mapping->getClassForType('first'));
$this->assertEquals(null, $mapping->getClassForType('second'));
$this->assertNull($mapping->getClassForType('second'));
}
public function testMappedObjectType()
@ -38,6 +38,6 @@ class ClassDiscriminatorMappingTest extends TestCase
));
$this->assertEquals('first', $mapping->getMappedObjectType(new AbstractDummyFirstChild()));
$this->assertEquals(null, $mapping->getMappedObjectType(new AbstractDummySecondChild()));
$this->assertNull($mapping->getMappedObjectType(new AbstractDummySecondChild()));
}
}

View File

@ -15,9 +15,6 @@ use PHPUnit\Framework\TestCase;
use Symfony\Component\Console\Application;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Tester\CommandTester;
use Symfony\Component\Console\Helper\HelperSet;
use Symfony\Component\Console\Input\InputDefinition;
use Symfony\Component\HttpKernel\KernelInterface;
use Symfony\Component\Translation\Command\XliffLintCommand;
/**