minor #39727 fix code style (xabbuh)
This PR was merged into the 5.2 branch.
Discussion
----------
fix code style
| Q | A
| ------------- | ---
| Branch? | 5.2
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets |
| License | MIT
| Doc PR |
Commits
-------
0fdf59c26d
fix code style
This commit is contained in:
commit
af13843668
@ -24,7 +24,7 @@ class HttpCodeActivationStrategyTest extends TestCase
|
||||
/**
|
||||
* @group legacy
|
||||
*/
|
||||
public function testExclusionsWithoutCodeLegacy(): void
|
||||
public function testExclusionsWithoutCodeLegacy()
|
||||
{
|
||||
$this->expectException('LogicException');
|
||||
new HttpCodeActivationStrategy(new RequestStack(), [['urls' => []]], Logger::WARNING);
|
||||
@ -33,7 +33,7 @@ class HttpCodeActivationStrategyTest extends TestCase
|
||||
/**
|
||||
* @group legacy
|
||||
*/
|
||||
public function testExclusionsWithoutUrlsLegacy(): void
|
||||
public function testExclusionsWithoutUrlsLegacy()
|
||||
{
|
||||
$this->expectException('LogicException');
|
||||
new HttpCodeActivationStrategy(new RequestStack(), [['code' => 404]], Logger::WARNING);
|
||||
@ -44,7 +44,7 @@ class HttpCodeActivationStrategyTest extends TestCase
|
||||
*
|
||||
* @group legacy
|
||||
*/
|
||||
public function testIsActivatedLegacy($url, $record, $expected): void
|
||||
public function testIsActivatedLegacy($url, $record, $expected)
|
||||
{
|
||||
$requestStack = new RequestStack();
|
||||
$requestStack->push(Request::create($url));
|
||||
@ -63,13 +63,13 @@ class HttpCodeActivationStrategyTest extends TestCase
|
||||
self::assertEquals($expected, $strategy->isHandlerActivated($record));
|
||||
}
|
||||
|
||||
public function testExclusionsWithoutCode(): void
|
||||
public function testExclusionsWithoutCode()
|
||||
{
|
||||
$this->expectException('LogicException');
|
||||
new HttpCodeActivationStrategy(new RequestStack(), [['urls' => []]], new ErrorLevelActivationStrategy(Logger::WARNING));
|
||||
}
|
||||
|
||||
public function testExclusionsWithoutUrls(): void
|
||||
public function testExclusionsWithoutUrls()
|
||||
{
|
||||
$this->expectException('LogicException');
|
||||
new HttpCodeActivationStrategy(new RequestStack(), [['code' => 404]], new ErrorLevelActivationStrategy(Logger::WARNING));
|
||||
|
@ -26,7 +26,7 @@ class NotFoundActivationStrategyTest extends TestCase
|
||||
*
|
||||
* @group legacy
|
||||
*/
|
||||
public function testIsActivatedLegacy(string $url, array $record, bool $expected): void
|
||||
public function testIsActivatedLegacy(string $url, array $record, bool $expected)
|
||||
{
|
||||
$requestStack = new RequestStack();
|
||||
$requestStack->push(Request::create($url));
|
||||
@ -39,7 +39,7 @@ class NotFoundActivationStrategyTest extends TestCase
|
||||
/**
|
||||
* @dataProvider isActivatedProvider
|
||||
*/
|
||||
public function testIsActivated(string $url, array $record, bool $expected): void
|
||||
public function testIsActivated(string $url, array $record, bool $expected)
|
||||
{
|
||||
$requestStack = new RequestStack();
|
||||
$requestStack->push(Request::create($url));
|
||||
|
@ -11,7 +11,7 @@ $container->loadFromExtension('framework', [
|
||||
'multiplier' => 2,
|
||||
'max_delay' => 0,
|
||||
'jitter' => 0.3,
|
||||
]
|
||||
],
|
||||
],
|
||||
'scoped_clients' => [
|
||||
'foo' => [
|
||||
|
@ -8,7 +8,7 @@ $container->loadFromExtension('framework', [
|
||||
'type' => 'state_machine',
|
||||
'marking_store' => [
|
||||
'type' => 'method',
|
||||
'property' => 'state'
|
||||
'property' => 'state',
|
||||
],
|
||||
'supports' => [
|
||||
FrameworkExtensionTest::class,
|
||||
@ -33,9 +33,9 @@ $container->loadFromExtension('framework', [
|
||||
'two',
|
||||
],
|
||||
'to' => [
|
||||
'three'
|
||||
]
|
||||
]
|
||||
'three',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
|
@ -8,7 +8,7 @@ $container->loadFromExtension('framework', [
|
||||
'type' => 'state_machine',
|
||||
'marking_store' => [
|
||||
'type' => 'method',
|
||||
'property' => 'state'
|
||||
'property' => 'state',
|
||||
],
|
||||
'supports' => [
|
||||
FrameworkExtensionTest::class,
|
||||
@ -36,9 +36,9 @@ $container->loadFromExtension('framework', [
|
||||
'two',
|
||||
],
|
||||
'to' => [
|
||||
'three'
|
||||
]
|
||||
]
|
||||
'three',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
|
@ -1371,7 +1371,7 @@ abstract class FrameworkExtensionTest extends TestCase
|
||||
$this->assertEquals($expected, $chain->getArguments());
|
||||
}
|
||||
|
||||
public function testRedisTagAwareAdapter(): void
|
||||
public function testRedisTagAwareAdapter()
|
||||
{
|
||||
$container = $this->createContainerFromFile('cache', [], true);
|
||||
|
||||
|
@ -629,7 +629,7 @@ class SecurityExtensionTest extends TestCase
|
||||
yield [['user_checker' => TestUserChecker::class], TestUserChecker::class];
|
||||
}
|
||||
|
||||
public function testConfigureCustomFirewallListener(): void
|
||||
public function testConfigureCustomFirewallListener()
|
||||
{
|
||||
$container = $this->getRawContainer();
|
||||
/** @var SecurityExtension $extension */
|
||||
|
@ -52,7 +52,7 @@ class RequestTest extends TestCase
|
||||
$this->assertEquals(['foo' => 'bar'], $request->getServer(), '->getServer() returns the server parameters of the request');
|
||||
}
|
||||
|
||||
public function testAllParameterValuesAreConvertedToString(): void
|
||||
public function testAllParameterValuesAreConvertedToString()
|
||||
{
|
||||
$parameters = [
|
||||
'foo' => 1,
|
||||
|
@ -215,7 +215,7 @@ class ArrayNode extends BaseNode implements PrototypeNodeInterface
|
||||
if ($child->isRequired()) {
|
||||
$message = sprintf('The child config "%s" under "%s" must be configured', $name, $this->getPath());
|
||||
if ($child->getInfo()) {
|
||||
$message .= sprintf(": %s", $child->getInfo());
|
||||
$message .= sprintf(': %s', $child->getInfo());
|
||||
} else {
|
||||
$message .= '.';
|
||||
}
|
||||
|
@ -26,7 +26,7 @@ class SignalRegistryTest extends TestCase
|
||||
pcntl_signal(\SIGUSR2, \SIG_DFL);
|
||||
}
|
||||
|
||||
public function testOneCallbackForASignal_signalIsHandled()
|
||||
public function testOneCallbackForASignalSignalIsHandled()
|
||||
{
|
||||
$signalRegistry = new SignalRegistry();
|
||||
|
||||
@ -40,7 +40,7 @@ class SignalRegistryTest extends TestCase
|
||||
$this->assertTrue($isHandled);
|
||||
}
|
||||
|
||||
public function testTwoCallbacksForASignal_bothCallbacksAreCalled()
|
||||
public function testTwoCallbacksForASignalBothCallbacksAreCalled()
|
||||
{
|
||||
$signalRegistry = new SignalRegistry();
|
||||
|
||||
@ -60,7 +60,7 @@ class SignalRegistryTest extends TestCase
|
||||
$this->assertTrue($isHandled2);
|
||||
}
|
||||
|
||||
public function testTwoSignals_signalsAreHandled()
|
||||
public function testTwoSignalsSignalsAreHandled()
|
||||
{
|
||||
$signalRegistry = new SignalRegistry();
|
||||
|
||||
@ -85,7 +85,7 @@ class SignalRegistryTest extends TestCase
|
||||
$this->assertTrue($isHandled2);
|
||||
}
|
||||
|
||||
public function testTwoCallbacksForASignal_previousAndRegisteredCallbacksWereCalled()
|
||||
public function testTwoCallbacksForASignalPreviousAndRegisteredCallbacksWereCalled()
|
||||
{
|
||||
$signalRegistry = new SignalRegistry();
|
||||
|
||||
@ -105,7 +105,7 @@ class SignalRegistryTest extends TestCase
|
||||
$this->assertTrue($isHandled2);
|
||||
}
|
||||
|
||||
public function testTwoCallbacksForASignal_previousCallbackFromAnotherRegistry()
|
||||
public function testTwoCallbacksForASignalPreviousCallbackFromAnotherRegistry()
|
||||
{
|
||||
$signalRegistry1 = new SignalRegistry();
|
||||
|
||||
|
@ -83,6 +83,7 @@ class TraceableResponse implements ResponseInterface, StreamableInterface
|
||||
if (false === $this->content) {
|
||||
return $this->response->getContent($throw);
|
||||
}
|
||||
|
||||
return $this->content = $this->response->getContent(false);
|
||||
} finally {
|
||||
if ($this->event && $this->event->isStarted()) {
|
||||
@ -100,6 +101,7 @@ class TraceableResponse implements ResponseInterface, StreamableInterface
|
||||
if (false === $this->content) {
|
||||
return $this->response->toArray($throw);
|
||||
}
|
||||
|
||||
return $this->content = $this->response->toArray(false);
|
||||
} finally {
|
||||
if ($this->event && $this->event->isStarted()) {
|
||||
|
@ -33,7 +33,7 @@ class MockResponseTest extends TestCase
|
||||
$response->toArray();
|
||||
}
|
||||
|
||||
public function testUrlHttpMethodMockResponse(): void
|
||||
public function testUrlHttpMethodMockResponse()
|
||||
{
|
||||
$responseMock = new MockResponse(json_encode(['foo' => 'bar']));
|
||||
$url = 'https://example.com/some-endpoint';
|
||||
|
@ -24,8 +24,8 @@ use Symfony\Component\Lock\Store\PostgreSqlStore;
|
||||
*/
|
||||
class PostgreSqlDbalStoreTest extends AbstractStoreTest
|
||||
{
|
||||
use SharedLockStoreTestTrait;
|
||||
use BlockingStoreTestTrait;
|
||||
use SharedLockStoreTestTrait;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
|
@ -24,8 +24,8 @@ use Symfony\Component\Lock\Store\PostgreSqlStore;
|
||||
*/
|
||||
class PostgreSqlStoreTest extends AbstractStoreTest
|
||||
{
|
||||
use SharedLockStoreTestTrait;
|
||||
use BlockingStoreTestTrait;
|
||||
use SharedLockStoreTestTrait;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
|
@ -21,7 +21,7 @@ use Symfony\Component\Messenger\Transport\Serialization\SerializerInterface;
|
||||
|
||||
class AmazonSqsSenderTest extends TestCase
|
||||
{
|
||||
public function testSend(): void
|
||||
public function testSend()
|
||||
{
|
||||
$envelope = new Envelope(new DummyMessage('Oy'));
|
||||
$encoded = ['body' => '...', 'headers' => ['type' => DummyMessage::class]];
|
||||
@ -38,7 +38,7 @@ class AmazonSqsSenderTest extends TestCase
|
||||
$sender->send($envelope);
|
||||
}
|
||||
|
||||
public function testSendWithAmazonSqsFifoStamp(): void
|
||||
public function testSendWithAmazonSqsFifoStamp()
|
||||
{
|
||||
$envelope = (new Envelope(new DummyMessage('Oy')))
|
||||
->with($stamp = new AmazonSqsFifoStamp('testGroup', 'testDeduplicationId'));
|
||||
|
@ -347,7 +347,7 @@ class ConnectionTest extends TestCase
|
||||
$factory->method('createQueue')->will($this->onConsecutiveCalls($amqpQueue0, $amqpQueue1));
|
||||
|
||||
$amqpExchange->expects($this->once())->method('declareExchange');
|
||||
$amqpExchange->expects($this->once())->method('publish')->with('body', 'routing_key', AMQP_NOPARAM, ['headers' => [], 'delivery_mode' => 2, 'timestamp' => time()]);
|
||||
$amqpExchange->expects($this->once())->method('publish')->with('body', 'routing_key', \AMQP_NOPARAM, ['headers' => [], 'delivery_mode' => 2, 'timestamp' => time()]);
|
||||
$amqpQueue0->expects($this->once())->method('declareQueue');
|
||||
$amqpQueue0->expects($this->exactly(2))->method('bind')->withConsecutive(
|
||||
[self::DEFAULT_EXCHANGE_NAME, 'binding_key0'],
|
||||
|
@ -10,7 +10,7 @@ use Symfony\Component\Messenger\Stamp\ErrorDetailsStamp;
|
||||
|
||||
final class AddErrorDetailsStampListenerTest extends TestCase
|
||||
{
|
||||
public function testExceptionDetailsAreAdded(): void
|
||||
public function testExceptionDetailsAreAdded()
|
||||
{
|
||||
$listener = new AddErrorDetailsStampListener();
|
||||
|
||||
|
@ -25,7 +25,7 @@ use Symfony\Component\Serializer\Serializer as SymfonySerializer;
|
||||
|
||||
class ErrorDetailsStampTest extends TestCase
|
||||
{
|
||||
public function testGetters(): void
|
||||
public function testGetters()
|
||||
{
|
||||
$exception = new \Exception('exception message');
|
||||
$flattenException = FlattenException::createFromThrowable($exception);
|
||||
@ -37,7 +37,7 @@ class ErrorDetailsStampTest extends TestCase
|
||||
$this->assertEquals($flattenException, $stamp->getFlattenException());
|
||||
}
|
||||
|
||||
public function testUnwrappingHandlerFailedException(): void
|
||||
public function testUnwrappingHandlerFailedException()
|
||||
{
|
||||
$wrappedException = new \Exception('I am inside', 123);
|
||||
$envelope = new Envelope(new \stdClass());
|
||||
@ -52,7 +52,7 @@ class ErrorDetailsStampTest extends TestCase
|
||||
$this->assertEquals($flattenException, $stamp->getFlattenException());
|
||||
}
|
||||
|
||||
public function testDeserialization(): void
|
||||
public function testDeserialization()
|
||||
{
|
||||
$exception = new \Exception('exception message');
|
||||
$stamp = ErrorDetailsStamp::create($exception);
|
||||
|
@ -21,7 +21,7 @@ use Symfony\Component\Notifier\Transport\Transports;
|
||||
|
||||
class TransportsTest extends TestCase
|
||||
{
|
||||
public function testSendToTransportDefinedByMessage(): void
|
||||
public function testSendToTransportDefinedByMessage()
|
||||
{
|
||||
$transports = new Transports([
|
||||
'one' => $one = $this->createMock(TransportInterface::class),
|
||||
@ -39,7 +39,7 @@ class TransportsTest extends TestCase
|
||||
$this->assertSame('one', $sentMessage->getTransport());
|
||||
}
|
||||
|
||||
public function testSendToFirstSupportedTransportIfMessageDoesNotDefineATransport(): void
|
||||
public function testSendToFirstSupportedTransportIfMessageDoesNotDefineATransport()
|
||||
{
|
||||
$transports = new Transports([
|
||||
'one' => $one = $this->createMock(TransportInterface::class),
|
||||
@ -63,7 +63,7 @@ class TransportsTest extends TestCase
|
||||
$this->assertSame('two', $sentMessage->getTransport());
|
||||
}
|
||||
|
||||
public function testThrowExceptionIfNoSupportedTransportWasFound(): void
|
||||
public function testThrowExceptionIfNoSupportedTransportWasFound()
|
||||
{
|
||||
$transports = new Transports([
|
||||
'one' => $one = $this->createMock(TransportInterface::class),
|
||||
@ -79,7 +79,7 @@ class TransportsTest extends TestCase
|
||||
$transports->send($message);
|
||||
}
|
||||
|
||||
public function testThrowExceptionIfTransportDefinedByMessageIsNotSupported(): void
|
||||
public function testThrowExceptionIfTransportDefinedByMessageIsNotSupported()
|
||||
{
|
||||
$transports = new Transports([
|
||||
'one' => $one = $this->createMock(TransportInterface::class),
|
||||
|
@ -55,7 +55,7 @@ abstract class TransportFactoryTestCase extends TestCase
|
||||
/**
|
||||
* @dataProvider supportsProvider
|
||||
*/
|
||||
public function testSupports(bool $expected, string $dsn): void
|
||||
public function testSupports(bool $expected, string $dsn)
|
||||
{
|
||||
$factory = $this->createFactory();
|
||||
|
||||
@ -65,7 +65,7 @@ abstract class TransportFactoryTestCase extends TestCase
|
||||
/**
|
||||
* @dataProvider createProvider
|
||||
*/
|
||||
public function testCreate(string $expected, string $dsn): void
|
||||
public function testCreate(string $expected, string $dsn)
|
||||
{
|
||||
$factory = $this->createFactory();
|
||||
$transport = $factory->create(Dsn::fromString($dsn));
|
||||
@ -76,7 +76,7 @@ abstract class TransportFactoryTestCase extends TestCase
|
||||
/**
|
||||
* @dataProvider unsupportedSchemeProvider
|
||||
*/
|
||||
public function testUnsupportedSchemeException(string $dsn, string $message = null): void
|
||||
public function testUnsupportedSchemeException(string $dsn, string $message = null)
|
||||
{
|
||||
$factory = $this->createFactory();
|
||||
|
||||
@ -93,7 +93,7 @@ abstract class TransportFactoryTestCase extends TestCase
|
||||
/**
|
||||
* @dataProvider incompleteDsnProvider
|
||||
*/
|
||||
public function testIncompleteDsnException(string $dsn, string $message = null): void
|
||||
public function testIncompleteDsnException(string $dsn, string $message = null)
|
||||
{
|
||||
$factory = $this->createFactory();
|
||||
|
||||
|
@ -47,7 +47,7 @@ abstract class TransportTestCase extends TestCase
|
||||
/**
|
||||
* @dataProvider toStringProvider
|
||||
*/
|
||||
public function testToString(string $expected, TransportInterface $transport): void
|
||||
public function testToString(string $expected, TransportInterface $transport)
|
||||
{
|
||||
$this->assertSame($expected, (string) $transport);
|
||||
}
|
||||
@ -55,7 +55,7 @@ abstract class TransportTestCase extends TestCase
|
||||
/**
|
||||
* @dataProvider supportedMessagesProvider
|
||||
*/
|
||||
public function testSupportedMessages(MessageInterface $message, ?TransportInterface $transport = null): void
|
||||
public function testSupportedMessages(MessageInterface $message, ?TransportInterface $transport = null)
|
||||
{
|
||||
if (null === $transport) {
|
||||
$transport = $this->createTransport();
|
||||
@ -67,7 +67,7 @@ abstract class TransportTestCase extends TestCase
|
||||
/**
|
||||
* @dataProvider unsupportedMessagesProvider
|
||||
*/
|
||||
public function testUnsupportedMessages(MessageInterface $message, ?TransportInterface $transport = null): void
|
||||
public function testUnsupportedMessages(MessageInterface $message, ?TransportInterface $transport = null)
|
||||
{
|
||||
if (null === $transport) {
|
||||
$transport = $this->createTransport();
|
||||
@ -79,7 +79,7 @@ abstract class TransportTestCase extends TestCase
|
||||
/**
|
||||
* @dataProvider unsupportedMessagesProvider
|
||||
*/
|
||||
public function testUnsupportedMessagesTrowLogicExceptionWhenSend(MessageInterface $message, ?TransportInterface $transport = null): void
|
||||
public function testUnsupportedMessagesTrowLogicExceptionWhenSend(MessageInterface $message, ?TransportInterface $transport = null)
|
||||
{
|
||||
if (null === $transport) {
|
||||
$transport = $this->createTransport();
|
||||
@ -90,7 +90,7 @@ abstract class TransportTestCase extends TestCase
|
||||
$transport->send($message);
|
||||
}
|
||||
|
||||
public function testCanSetCustomHost(): void
|
||||
public function testCanSetCustomHost()
|
||||
{
|
||||
$transport = $this->createTransport();
|
||||
|
||||
@ -99,7 +99,7 @@ abstract class TransportTestCase extends TestCase
|
||||
$this->assertStringContainsString(sprintf('://%s', $customHost), (string) $transport);
|
||||
}
|
||||
|
||||
public function testCanSetCustomPort(): void
|
||||
public function testCanSetCustomPort()
|
||||
{
|
||||
$transport = $this->createTransport();
|
||||
|
||||
@ -111,7 +111,7 @@ abstract class TransportTestCase extends TestCase
|
||||
$this->assertMatchesRegularExpression(sprintf('/^.*\/\/.*\:%s.*$/', $customPort), (string) $transport);
|
||||
}
|
||||
|
||||
public function testCanSetCustomHostAndPort(): void
|
||||
public function testCanSetCustomHostAndPort()
|
||||
{
|
||||
$transport = $this->createTransport();
|
||||
|
||||
|
@ -41,7 +41,7 @@ class ConstructorExtractorTest extends TestCase
|
||||
$this->assertEquals([new Type(Type::BUILTIN_TYPE_STRING)], $this->extractor->getTypes('Foo', 'bar', []));
|
||||
}
|
||||
|
||||
public function testGetTypes_ifNoExtractors()
|
||||
public function testGetTypesIfNoExtractors()
|
||||
{
|
||||
$extractor = new ConstructorExtractor([]);
|
||||
$this->assertNull($extractor->getTypes('Foo', 'bar', []));
|
||||
|
@ -122,7 +122,7 @@ final class PhpDocTypeHelper
|
||||
$collectionKeyType = $this->getTypes($type->getKeyType())[0];
|
||||
|
||||
$collectionValueTypes = $this->getTypes($type->getValueType());
|
||||
if (\count($collectionValueTypes) != 1) {
|
||||
if (1 != \count($collectionValueTypes)) {
|
||||
// the Type class does not support union types yet, so assume that no type was defined
|
||||
$collectionValueType = null;
|
||||
} else {
|
||||
|
@ -156,7 +156,7 @@ class AuthenticatorManagerTest extends TestCase
|
||||
yield [false];
|
||||
}
|
||||
|
||||
public function testAuthenticateRequestCanModifyTokenFromEvent(): void
|
||||
public function testAuthenticateRequestCanModifyTokenFromEvent()
|
||||
{
|
||||
$authenticator = $this->createAuthenticator();
|
||||
$this->request->attributes->set('_security_authenticators', [$authenticator]);
|
||||
@ -191,7 +191,7 @@ class AuthenticatorManagerTest extends TestCase
|
||||
$manager->authenticateUser($this->user, $authenticator, $this->request);
|
||||
}
|
||||
|
||||
public function testAuthenticateUserCanModifyTokenFromEvent(): void
|
||||
public function testAuthenticateUserCanModifyTokenFromEvent()
|
||||
{
|
||||
$authenticator = $this->createAuthenticator();
|
||||
$authenticator->expects($this->any())->method('createAuthenticatedToken')->willReturn($this->token);
|
||||
|
@ -7,9 +7,9 @@ use PHPUnit\Framework\TestCase;
|
||||
use Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactory;
|
||||
use Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactoryCompiler;
|
||||
use Symfony\Component\Serializer\Mapping\Loader\AnnotationLoader;
|
||||
use Symfony\Component\Serializer\Tests\Fixtures\Dummy;
|
||||
use Symfony\Component\Serializer\Tests\Fixtures\Annotations\MaxDepthDummy;
|
||||
use Symfony\Component\Serializer\Tests\Fixtures\Annotations\SerializedNameDummy;
|
||||
use Symfony\Component\Serializer\Tests\Fixtures\Dummy;
|
||||
|
||||
final class ClassMetadataFactoryCompilerTest extends TestCase
|
||||
{
|
||||
|
@ -7,8 +7,8 @@ use Symfony\Component\Serializer\Mapping\AttributeMetadata;
|
||||
use Symfony\Component\Serializer\Mapping\ClassMetadata;
|
||||
use Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactoryInterface;
|
||||
use Symfony\Component\Serializer\Mapping\Factory\CompiledClassMetadataFactory;
|
||||
use Symfony\Component\Serializer\Tests\Fixtures\Dummy;
|
||||
use Symfony\Component\Serializer\Tests\Fixtures\Annotations\SerializedNameDummy;
|
||||
use Symfony\Component\Serializer\Tests\Fixtures\Dummy;
|
||||
|
||||
/**
|
||||
* @author Fabien Bourigault <bourigaultfabien@gmail.com>
|
||||
|
@ -18,8 +18,8 @@ use Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactoryInterface;
|
||||
use Symfony\Component\Serializer\Mapping\Loader\AnnotationLoader;
|
||||
use Symfony\Component\Serializer\NameConverter\MetadataAwareNameConverter;
|
||||
use Symfony\Component\Serializer\NameConverter\NameConverterInterface;
|
||||
use Symfony\Component\Serializer\Tests\Fixtures\OtherSerializedNameDummy;
|
||||
use Symfony\Component\Serializer\Tests\Fixtures\Annotations\SerializedNameDummy;
|
||||
use Symfony\Component\Serializer\Tests\Fixtures\OtherSerializedNameDummy;
|
||||
|
||||
/**
|
||||
* @author Fabien Bourigault <bourigaultfabien@gmail.com>
|
||||
|
@ -14,8 +14,8 @@ use Symfony\Component\Serializer\Normalizer\ObjectNormalizer;
|
||||
use Symfony\Component\Serializer\Normalizer\PropertyNormalizer;
|
||||
use Symfony\Component\Serializer\Serializer;
|
||||
use Symfony\Component\Serializer\Tests\Fixtures\AbstractNormalizerDummy;
|
||||
use Symfony\Component\Serializer\Tests\Fixtures\Dummy;
|
||||
use Symfony\Component\Serializer\Tests\Fixtures\Annotations\IgnoreDummy;
|
||||
use Symfony\Component\Serializer\Tests\Fixtures\Dummy;
|
||||
use Symfony\Component\Serializer\Tests\Fixtures\NullableConstructorArgumentDummy;
|
||||
use Symfony\Component\Serializer\Tests\Fixtures\StaticConstructorDummy;
|
||||
use Symfony\Component\Serializer\Tests\Fixtures\StaticConstructorNormalizer;
|
||||
|
@ -27,8 +27,8 @@ use Symfony\Component\Serializer\Normalizer\GetSetMethodNormalizer;
|
||||
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
|
||||
use Symfony\Component\Serializer\Serializer;
|
||||
use Symfony\Component\Serializer\SerializerInterface;
|
||||
use Symfony\Component\Serializer\Tests\Fixtures\CircularReferenceDummy;
|
||||
use Symfony\Component\Serializer\Tests\Fixtures\Annotations\GroupDummy;
|
||||
use Symfony\Component\Serializer\Tests\Fixtures\CircularReferenceDummy;
|
||||
use Symfony\Component\Serializer\Tests\Fixtures\SiblingHolder;
|
||||
use Symfony\Component\Serializer\Tests\Normalizer\Features\CallbacksTestTrait;
|
||||
use Symfony\Component\Serializer\Tests\Normalizer\Features\CircularReferenceTestTrait;
|
||||
|
@ -25,9 +25,9 @@ use Symfony\Component\Serializer\Normalizer\DenormalizerInterface;
|
||||
use Symfony\Component\Serializer\Normalizer\PropertyNormalizer;
|
||||
use Symfony\Component\Serializer\Serializer;
|
||||
use Symfony\Component\Serializer\SerializerInterface;
|
||||
use Symfony\Component\Serializer\Tests\Fixtures\Dummy;
|
||||
use Symfony\Component\Serializer\Tests\Fixtures\Annotations\GroupDummy;
|
||||
use Symfony\Component\Serializer\Tests\Fixtures\Annotations\GroupDummyChild;
|
||||
use Symfony\Component\Serializer\Tests\Fixtures\Dummy;
|
||||
use Symfony\Component\Serializer\Tests\Fixtures\Php74Dummy;
|
||||
use Symfony\Component\Serializer\Tests\Fixtures\PropertyCircularReferenceDummy;
|
||||
use Symfony\Component\Serializer\Tests\Fixtures\PropertySiblingHolder;
|
||||
|
@ -3,7 +3,6 @@
|
||||
namespace Symfony\Component\Serializer\Tests\Normalizer;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Symfony\Component\Serializer\Exception\InvalidArgumentException;
|
||||
use Symfony\Component\Serializer\Normalizer\UidNormalizer;
|
||||
use Symfony\Component\Uid\AbstractUid;
|
||||
use Symfony\Component\Uid\Ulid;
|
||||
|
@ -20,7 +20,7 @@ final class PseudoLocalizationTranslatorTest extends TestCase
|
||||
/**
|
||||
* @dataProvider provideTrans
|
||||
*/
|
||||
public function testTrans(string $expected, string $input, array $options = []): void
|
||||
public function testTrans(string $expected, string $input, array $options = [])
|
||||
{
|
||||
mt_srand(987);
|
||||
$this->assertSame($expected, (new PseudoLocalizationTranslator(new IdentityTranslator(), $options))->trans($input));
|
||||
@ -50,7 +50,7 @@ final class PseudoLocalizationTranslatorTest extends TestCase
|
||||
/**
|
||||
* @dataProvider provideInvalidExpansionFactor
|
||||
*/
|
||||
public function testInvalidExpansionFactor(float $expansionFactor): void
|
||||
public function testInvalidExpansionFactor(float $expansionFactor)
|
||||
{
|
||||
$this->expectException(\InvalidArgumentException::class);
|
||||
$this->expectExceptionMessage('The expansion factor must be greater than or equal to 1.');
|
||||
|
@ -38,7 +38,7 @@ class Regex extends Constraint
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @param string|array $pattern The pattern to evaluate or an array of options.
|
||||
* @param string|array $pattern The pattern to evaluate or an array of options
|
||||
*/
|
||||
public function __construct(
|
||||
$pattern,
|
||||
|
@ -44,7 +44,7 @@ class Timezone extends Constraint
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @param int|array|null $zone A combination of {@see \DateTimeZone} class constants or a set of options.
|
||||
* @param int|array|null $zone A combination of {@see \DateTimeZone} class constants or a set of options
|
||||
*/
|
||||
public function __construct(
|
||||
$zone = null,
|
||||
|
@ -34,7 +34,7 @@ class Type extends Constraint
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
* @param string|array $type One ore multiple types to validate against or a set of options.
|
||||
* @param string|array $type One ore multiple types to validate against or a set of options
|
||||
*/
|
||||
public function __construct($type, string $message = null, array $groups = null, $payload = null, array $options = [])
|
||||
{
|
||||
|
@ -26,7 +26,7 @@ use Symfony\Component\Validator\Tests\Dummy\DummyClassOne;
|
||||
*/
|
||||
class DebugCommandTest extends TestCase
|
||||
{
|
||||
public function testOutputWithClassArgument(): void
|
||||
public function testOutputWithClassArgument()
|
||||
{
|
||||
$validator = $this->createMock(MetadataFactoryInterface::class);
|
||||
$classMetadata = $this->createMock(ClassMetadataInterface::class);
|
||||
@ -90,7 +90,7 @@ TXT
|
||||
);
|
||||
}
|
||||
|
||||
public function testOutputWithPathArgument(): void
|
||||
public function testOutputWithPathArgument()
|
||||
{
|
||||
$validator = $this->createMock(MetadataFactoryInterface::class);
|
||||
$classMetadata = $this->createMock(ClassMetadataInterface::class);
|
||||
@ -171,7 +171,7 @@ TXT
|
||||
);
|
||||
}
|
||||
|
||||
public function testOutputWithInvalidClassArgument(): void
|
||||
public function testOutputWithInvalidClassArgument()
|
||||
{
|
||||
$validator = $this->createMock(MetadataFactoryInterface::class);
|
||||
|
||||
|
@ -161,7 +161,6 @@ class LanguageValidatorTest extends ConstraintValidatorTestCase
|
||||
eval('return new \Symfony\Component\Validator\Constraints\Language(alpha3: true, message: "myMessage");')
|
||||
);
|
||||
|
||||
|
||||
$this->buildViolation('myMessage')
|
||||
->setParameter('{{ value }}', '"DE"')
|
||||
->setCode(Language::NO_SUCH_LANGUAGE_ERROR)
|
||||
|
@ -17,10 +17,11 @@ class ConstraintChoiceWithPreset extends Choice
|
||||
{
|
||||
public $type;
|
||||
|
||||
public function __construct(string $type) {
|
||||
public function __construct(string $type)
|
||||
{
|
||||
parent::__construct($type);
|
||||
|
||||
if ($this->type === 'A') {
|
||||
if ('A' === $this->type) {
|
||||
$this->choices = ['A', 'B', 'C'];
|
||||
} else {
|
||||
$this->choices = ['D', 'E', 'F'];
|
||||
|
Reference in New Issue
Block a user