@@ -110,12 +110,12 @@ discard block |
||
110 | 110 | $builder = $this->doctrine->getRepository($entity->getName())->createQueryBuilder('e'); |
111 | 111 | |
112 | 112 | $sort = $request->get('sort'); |
113 | - if($sort) { |
|
114 | - $sort = lcfirst(implode('', array_map(function ($key) { |
|
113 | + if ($sort) { |
|
114 | + $sort = lcfirst(implode('', array_map(function($key) { |
|
115 | 115 | return ucfirst($key); |
116 | 116 | }, explode('_', $sort)))); |
117 | 117 | |
118 | - if(!$entity->hasProperty($sort)) { |
|
118 | + if (!$entity->hasProperty($sort)) { |
|
119 | 119 | throw new BadRequestHttpException(sprintf('There is no such field %s', $sort)); |
120 | 120 | } |
121 | 121 | $builder->orderBy( |
@@ -124,9 +124,9 @@ discard block |
||
124 | 124 | ); |
125 | 125 | } |
126 | 126 | |
127 | - foreach($entity->getProperties() as $property) { |
|
127 | + foreach ($entity->getProperties() as $property) { |
|
128 | 128 | $name = $property->getName(); |
129 | - if($value = $request->get($name)) { |
|
129 | + if ($value = $request->get($name)) { |
|
130 | 130 | $builder->andWhere($builder->expr()->orX( |
131 | 131 | $builder->expr()->like('e.'.$name, ':value') |
132 | 132 | )); |
@@ -24,7 +24,6 @@ |
||
24 | 24 | |
25 | 25 | /** |
26 | 26 | * @var Reader |
27 | - |
|
28 | 27 | */ |
29 | 28 | private $annotationReader; |
30 | 29 |
@@ -442,13 +442,13 @@ |
||
442 | 442 | ->disableOriginalClone() |
443 | 443 | ->getMock(); |
444 | 444 | |
445 | - if($expectedMethod){ |
|
446 | - if($methodParameter){ |
|
445 | + if ($expectedMethod) { |
|
446 | + if ($methodParameter) { |
|
447 | 447 | $mock->expects($this->any()) |
448 | 448 | ->method($expectedMethod) |
449 | 449 | ->with($methodParameter) |
450 | 450 | ->willReturn($willReturn); |
451 | - } else{ |
|
451 | + } else { |
|
452 | 452 | $mock->expects($this->any()) |
453 | 453 | ->method($expectedMethod) |
454 | 454 | ->willReturn($willReturn); |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | $reflection = $this->mock(\ReflectionProperty::class); |
198 | 198 | |
199 | 199 | $access = new CanBeCreatedBy(); |
200 | - $access->roles = ['ROLE_USER','ROLE_ADMIN']; |
|
200 | + $access->roles = ['ROLE_USER', 'ROLE_ADMIN']; |
|
201 | 201 | $annReader = $this->mock(Reader::class, 'getPropertyAnnotations', [$access], $reflection); |
202 | 202 | |
203 | 203 | $accessManager = new AccessManager($tokenStorageMock, $annReader); |
@@ -405,7 +405,7 @@ discard block |
||
405 | 405 | $reflection = $this->mock(\ReflectionClass::class); |
406 | 406 | |
407 | 407 | $access = new CanBeDeletedBy(); |
408 | - $access->roles = ['ROLE_USER','ROLE_ADMIN']; |
|
408 | + $access->roles = ['ROLE_USER', 'ROLE_ADMIN']; |
|
409 | 409 | $annReader = $this->mock(Reader::class, 'getClassAnnotations', [$access], $reflection); |
410 | 410 | |
411 | 411 | $accessManager = new AccessManager($tokenStorageMock, $annReader); |
@@ -463,13 +463,13 @@ discard block |
||
463 | 463 | { |
464 | 464 | $mock = $this->createMock($class); |
465 | 465 | |
466 | - if($expectedMethod){ |
|
467 | - if($methodParameter){ |
|
466 | + if ($expectedMethod) { |
|
467 | + if ($methodParameter) { |
|
468 | 468 | $mock->expects($this->any()) |
469 | 469 | ->method($expectedMethod) |
470 | 470 | ->with($methodParameter) |
471 | 471 | ->willReturn($willReturn); |
472 | - } else{ |
|
472 | + } else { |
|
473 | 473 | $mock->expects($this->any()) |
474 | 474 | ->method($expectedMethod) |
475 | 475 | ->willReturn($willReturn); |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | |
35 | 35 | $factory = new Factory($formFactory, $reader, $accessManager); |
36 | 36 | |
37 | - $this->assertEquals('OK', $factory->getCreateForm($entity)); |
|
37 | + $this->assertEquals('OK', $factory->getCreateForm($entity)); |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | public function testFactoryGetEditForm() |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | |
49 | 49 | $factory = new Factory($formFactory, $reader, $accessManager); |
50 | 50 | |
51 | - $this->assertEquals('OK', $factory->getEditForm($entity)); |
|
51 | + $this->assertEquals('OK', $factory->getEditForm($entity)); |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | private function mock($class, $expectedMethod = null, $willReturn = null, $methodParameter = null) |
@@ -57,13 +57,13 @@ discard block |
||
57 | 57 | ->disableOriginalConstructor() |
58 | 58 | ->getMock(); |
59 | 59 | |
60 | - if($expectedMethod){ |
|
61 | - if($methodParameter){ |
|
60 | + if ($expectedMethod) { |
|
61 | + if ($methodParameter) { |
|
62 | 62 | $mock->expects($this->any()) |
63 | 63 | ->method($expectedMethod) |
64 | 64 | ->with($methodParameter) |
65 | 65 | ->willReturn($willReturn); |
66 | - } else{ |
|
66 | + } else { |
|
67 | 67 | $mock->expects($this->any()) |
68 | 68 | ->method($expectedMethod) |
69 | 69 | ->willReturn($willReturn); |