Skip to content

Commit 026eab1

Browse files
committed
fixes cs issues
1 parent 2509241 commit 026eab1

14 files changed

+44
-44
lines changed

src/Validator/Constraints/ExpressionValidator.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class ExpressionValidator extends \Symfony\Component\Validator\Constraints\Expre
2121
public function __construct(ExpressionLanguage $expressionLanguage, GlobalVariables $globalVariables)
2222
{
2323
$this->expressionLanguage = $expressionLanguage;
24-
$this->globalVariables = $globalVariables;
24+
$this->globalVariables = $globalVariables;
2525
if (Kernel::VERSION_ID >= 40400) {
2626
parent::__construct($expressionLanguage);
2727
} else {
@@ -35,11 +35,11 @@ public function __construct(ExpressionLanguage $expressionLanguage, GlobalVariab
3535
public function validate($value, Constraint $constraint): void
3636
{
3737
if (!$constraint instanceof Expression) {
38-
throw new UnexpectedTypeException($constraint, __NAMESPACE__ . '\Expression');
38+
throw new UnexpectedTypeException($constraint, __NAMESPACE__.'\Expression');
3939
}
4040

41-
$variables = $constraint->values;
42-
$variables['value'] = $value;
41+
$variables = $constraint->values;
42+
$variables['value'] = $value;
4343
$variables['globalVariable'] = $this->globalVariables;
4444

4545
$object = $this->context->getObject();
@@ -48,9 +48,9 @@ public function validate($value, Constraint $constraint): void
4848

4949
if ($object instanceof ValidationNode) {
5050
$variables['parentValue'] = $object->getResolverArg('value');
51-
$variables['context'] = $object->getResolverArg('context');
52-
$variables['args'] = $object->getResolverArg('args');
53-
$variables['info'] = $object->getResolverArg('info');
51+
$variables['context'] = $object->getResolverArg('context');
52+
$variables['args'] = $object->getResolverArg('args');
53+
$variables['info'] = $object->getResolverArg('info');
5454
}
5555

5656
if (!$this->expressionLanguage->evaluate($constraint->expression, $variables)) {

tests/ExpressionLanguage/ExpressionFunction/DependencyInjection/ParameterTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public function testParameterCompilation($name): void
2626
{
2727
$globalVariable = new GlobalVariables(['container' => $this->getDIContainerMock([], ['test' => 5])]);
2828
$globalVariable->get('container');
29-
$this->assertSame(5, eval('return ' . $this->expressionLanguage->compile($name . '("test")') . ';'));
29+
$this->assertSame(5, eval('return '.$this->expressionLanguage->compile($name.'("test")').';'));
3030
}
3131

3232
/**
@@ -38,7 +38,7 @@ public function testParameterEvaluation($name): void
3838
$globalVariable = new GlobalVariables(['container' => $this->getDIContainerMock([], ['test' => 5])]);
3939
$this->assertSame(
4040
5,
41-
$this->expressionLanguage->evaluate($name . '("test")', ['globalVariable' => $globalVariable])
41+
$this->expressionLanguage->evaluate($name.'("test")', ['globalVariable' => $globalVariable])
4242
);
4343
}
4444

tests/ExpressionLanguage/ExpressionFunction/DependencyInjection/ServiceTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ protected function getFunctions()
2424
*/
2525
public function testServiceCompilation(string $name): void
2626
{
27-
$object = new \stdClass();
27+
$object = new \stdClass();
2828
$globalVariable = new GlobalVariables(['container' => $this->getDIContainerMock(['toto' => $object])]);
2929
$globalVariable->get('container');
30-
$this->assertSame($object, eval('return ' . $this->expressionLanguage->compile($name . '("toto")') . ';'));
30+
$this->assertSame($object, eval('return '.$this->expressionLanguage->compile($name.'("toto")').';'));
3131
}
3232

3333
/**
@@ -37,11 +37,11 @@ public function testServiceCompilation(string $name): void
3737
*/
3838
public function testServiceEvaluation(string $name): void
3939
{
40-
$object = new \stdClass();
40+
$object = new \stdClass();
4141
$globalVariable = new GlobalVariables(['container' => $this->getDIContainerMock(['toto' => $object])]);
4242
$this->assertSame(
4343
$object,
44-
$this->expressionLanguage->evaluate($name . '("toto")', ['globalVariable' => $globalVariable])
44+
$this->expressionLanguage->evaluate($name.'("toto")', ['globalVariable' => $globalVariable])
4545
);
4646
}
4747

tests/ExpressionLanguage/ExpressionFunction/GraphQL/ArgumentsTest.php

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ protected function getFunctions()
3333

3434
public function getResolveInfo($types): ResolveInfo
3535
{
36-
$info = $this->getMockBuilder(ResolveInfo::class)->disableOriginalConstructor()->getMock();
36+
$info = $this->getMockBuilder(ResolveInfo::class)->disableOriginalConstructor()->getMock();
3737
$info->schema = new Schema(['types' => $types]);
3838

3939
return $info;
@@ -55,25 +55,25 @@ public function testEvaluator(): void
5555
$info = $this->getResolveInfo(ArgumentsTransformerTest::getTypes());
5656

5757
$mapping = [
58-
'input1' => 'InputType1',
59-
'input2' => 'InputType2',
60-
'enum1' => 'Enum1',
61-
'int1' => 'Int!',
58+
'input1' => 'InputType1',
59+
'input2' => 'InputType2',
60+
'enum1' => 'Enum1',
61+
'int1' => 'Int!',
6262
'string1' => 'String!',
6363
];
64-
$data = [
65-
'input1' => ['field1' => 'hello', 'field2' => 12, 'field3' => true],
66-
'input2' => ['field1' => [['field1' => 'hello1'], ['field1' => 'hello2']], 'field2' => 12],
67-
'enum1' => 2,
68-
'int1' => 14,
64+
$data = [
65+
'input1' => ['field1' => 'hello', 'field2' => 12, 'field3' => true],
66+
'input2' => ['field1' => [['field1' => 'hello1'], ['field1' => 'hello2']], 'field2' => 12],
67+
'enum1' => 2,
68+
'int1' => 14,
6969
'string1' => 'test_string',
7070
];
7171

7272
$transformer = $this->getTransformer(
7373
[
7474
'InputType1' => ['type' => 'input', 'class' => 'Overblog\GraphQLBundle\Tests\Transformer\InputType1'],
7575
'InputType2' => ['type' => 'input', 'class' => 'Overblog\GraphQLBundle\Tests\Transformer\InputType2'],
76-
'Enum1' => ['type' => 'enum', 'class' => 'Overblog\GraphQLBundle\Tests\Transformer\Enum1'],
76+
'Enum1' => ['type' => 'enum', 'class' => 'Overblog\GraphQLBundle\Tests\Transformer\Enum1'],
7777
]
7878
);
7979

@@ -87,9 +87,9 @@ public function testEvaluator(): void
8787
'arguments(mapping, data, info)',
8888
[
8989
'globalVariable' => $globalVariable,
90-
'mapping' => $mapping,
91-
'data' => $data,
92-
'info' => $info,
90+
'mapping' => $mapping,
91+
'data' => $data,
92+
'info' => $info,
9393
]
9494
);
9595

@@ -101,7 +101,7 @@ public function testEvaluator(): void
101101
$this->assertEquals($res[4], 'test_string');
102102

103103
$data = [];
104-
$res = $transformer->getInstanceAndValidate('InputType1', $data, $info, 'input1');
104+
$res = $transformer->getInstanceAndValidate('InputType1', $data, $info, 'input1');
105105
$this->assertInstanceOf(InputType1::class, $res);
106106

107107
$res = $transformer->getInstanceAndValidate('InputType2', ['field3' => 'enum1'], $info, 'input2');

tests/ExpressionLanguage/ExpressionFunction/Security/GetUserTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ protected function getFunctions()
2323

2424
public function testEvaluator(): void
2525
{
26-
$testUser = new User('testUser', 'testPassword');
26+
$testUser = new User('testUser', 'testPassword');
2727
$coreSecurity = $this->createMock(CoreSecurity::class);
2828
$coreSecurity->method('getUser')->willReturn($testUser);
2929
$globalVariable = new GlobalVariables(['security' => new Security($coreSecurity)]);
@@ -41,7 +41,7 @@ public function testGetUserNoTokenStorage(): void
4141

4242
public function testGetUserNoToken(): void
4343
{
44-
$tokenStorage = $this->getMockBuilder(TokenStorageInterface::class)->getMock();
44+
$tokenStorage = $this->getMockBuilder(TokenStorageInterface::class)->getMock();
4545
$globalVariable = new GlobalVariables(
4646
[
4747
'security' => new Security(
@@ -65,8 +65,8 @@ public function testGetUserNoToken(): void
6565
*/
6666
public function testGetUser($user, $expectedUser): void
6767
{
68-
$tokenStorage = $this->getMockBuilder(TokenStorageInterface::class)->getMock();
69-
$token = $this->getMockBuilder(TokenInterface::class)->getMock();
68+
$tokenStorage = $this->getMockBuilder(TokenStorageInterface::class)->getMock();
69+
$token = $this->getMockBuilder(TokenInterface::class)->getMock();
7070
$globalVariable = new GlobalVariables(
7171
[
7272
'security' => new Security(
@@ -105,6 +105,6 @@ public function getUserProvider()
105105

106106
private function getCompileCode()
107107
{
108-
return 'return ' . $this->expressionLanguage->compile('getUser()') . ';';
108+
return 'return '.$this->expressionLanguage->compile('getUser()').';';
109109
}
110110
}

tests/ExpressionLanguage/ExpressionFunction/Security/HasAnyPermissionTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ protected function getFunctions()
2020
public function testEvaluator(): void
2121
{
2222
$expectedObject = new \stdClass();
23-
$security = $this->getSecurityIsGrantedWithExpectation(
23+
$security = $this->getSecurityIsGrantedWithExpectation(
2424
[
2525
$this->matchesRegularExpression('/^(OWNER|WRITER)$/'),
2626
$this->identicalTo($expectedObject),
@@ -33,7 +33,7 @@ public function testEvaluator(): void
3333
$this->testedExpression,
3434
[
3535
'globalVariable' => $globalVariable,
36-
'object' => $expectedObject,
36+
'object' => $expectedObject,
3737
]
3838
);
3939
$this->assertTrue($hasPermission);

tests/ExpressionLanguage/ExpressionFunction/Security/HasAnyRoleTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ protected function getFunctions()
1717

1818
public function testEvaluator(): void
1919
{
20-
$security = $this->getSecurityIsGrantedWithExpectation('ROLE_ADMIN', $this->any());
20+
$security = $this->getSecurityIsGrantedWithExpectation('ROLE_ADMIN', $this->any());
2121
$globalVariable = new GlobalVariables(['security' => $security]);
2222

2323
$hasRole = $this->expressionLanguage->evaluate(

tests/ExpressionLanguage/ExpressionFunction/Security/HasPermissionTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ protected function getFunctions()
2020
public function testEvaluator(): void
2121
{
2222
$expectedObject = new \stdClass();
23-
$security = $this->getSecurityIsGrantedWithExpectation(
23+
$security = $this->getSecurityIsGrantedWithExpectation(
2424
[
2525
'OWNER',
2626
$this->identicalTo($expectedObject),
@@ -33,7 +33,7 @@ public function testEvaluator(): void
3333
$this->testedExpression,
3434
[
3535
'globalVariable' => $globalVariable,
36-
'object' => $expectedObject,
36+
'object' => $expectedObject,
3737
]
3838
);
3939
$this->assertTrue($hasPermission);

tests/ExpressionLanguage/ExpressionFunction/Security/HasRoleTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ protected function getFunctions()
1717

1818
public function testEvaluator(): void
1919
{
20-
$security = $this->getSecurityIsGrantedWithExpectation(
20+
$security = $this->getSecurityIsGrantedWithExpectation(
2121
'ROLE_USER',
2222
$this->any()
2323
);

tests/ExpressionLanguage/ExpressionFunction/Security/IsAnonymousTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ protected function getFunctions()
1717

1818
public function testEvaluator(): void
1919
{
20-
$security = $this->getSecurityIsGrantedWithExpectation(
20+
$security = $this->getSecurityIsGrantedWithExpectation(
2121
'IS_AUTHENTICATED_ANONYMOUSLY',
2222
$this->any()
2323
);

tests/ExpressionLanguage/ExpressionFunction/Security/IsAuthenticatedTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ protected function getFunctions()
1717

1818
public function testEvaluator(): void
1919
{
20-
$security = $this->getSecurityIsGrantedWithExpectation(
20+
$security = $this->getSecurityIsGrantedWithExpectation(
2121
$this->matchesRegularExpression('/^IS_AUTHENTICATED_(REMEMBERED|FULLY)$/'),
2222
$this->any()
2323
);

tests/ExpressionLanguage/ExpressionFunction/Security/IsFullyAuthenticatedTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ protected function getFunctions()
1717

1818
public function testEvaluator(): void
1919
{
20-
$security = $this->getSecurityIsGrantedWithExpectation(
20+
$security = $this->getSecurityIsGrantedWithExpectation(
2121
'IS_AUTHENTICATED_FULLY',
2222
$this->any()
2323
);

tests/ExpressionLanguage/ExpressionFunction/Security/IsGrantedTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ protected function getFunctions()
1717

1818
public function testEvaluator(): void
1919
{
20-
$security = $this->getSecurityIsGrantedWithExpectation(
20+
$security = $this->getSecurityIsGrantedWithExpectation(
2121
$this->matchesRegularExpression('/^ROLE_(USER|ADMIN)$/'),
2222
$this->any()
2323
);

tests/ExpressionLanguage/ExpressionFunction/Security/IsRememberMeTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ protected function getFunctions()
1717

1818
public function testEvaluator(): void
1919
{
20-
$security = $this->getSecurityIsGrantedWithExpectation(
20+
$security = $this->getSecurityIsGrantedWithExpectation(
2121
'IS_AUTHENTICATED_REMEMBERED',
2222
$this->any()
2323
);

0 commit comments

Comments
 (0)