Completed
Push — master ( 08f5ac...8a193d )
by Iakov
03:27
created
Security/AccessManager.php 1 patch
Indentation   -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,6 @@
 block discarded – undo
24 24
 
25 25
     /**
26 26
      * @var Reader
27
-
28 27
      */
29 28
     private $annotationReader;
30 29
 
Please login to merge, or discard this patch.
Tests/Manager/ApiManagerTest.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -442,13 +442,13 @@
 block discarded – undo
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);
Please login to merge, or discard this patch.
Tests/Security/AccessManagerTest.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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);
Please login to merge, or discard this patch.
Tests/Form/FactoryTest.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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);
Please login to merge, or discard this patch.
Manager/ApiManager.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -107,18 +107,18 @@  discard block
 block discarded – undo
107 107
     public function filter(Request $request)
108 108
     {
109 109
         $entity = new \ReflectionClass($request->attributes->get('_entity'));
110
-        if(!$this->accessManager->canAccessResource($entity)) {
110
+        if (!$this->accessManager->canAccessResource($entity)) {
111 111
             throw new AccessDeniedHttpException();
112 112
         }
113 113
         $builder = $this->doctrine->getRepository($entity->getName())->createQueryBuilder('e');
114 114
 
115 115
         $sort = $request->get('sort');
116
-        if($sort) {
117
-            $sort = lcfirst(implode('', array_map(function ($key) {
116
+        if ($sort) {
117
+            $sort = lcfirst(implode('', array_map(function($key) {
118 118
                 return ucfirst($key);
119 119
             }, explode('_', $sort))));
120 120
 
121
-            if(!$entity->hasProperty($sort)) {
121
+            if (!$entity->hasProperty($sort)) {
122 122
                 throw new BadRequestHttpException(sprintf('There is no such field %s', $sort));
123 123
             }
124 124
             $builder->orderBy(
@@ -127,9 +127,9 @@  discard block
 block discarded – undo
127 127
             );
128 128
         }
129 129
 
130
-        foreach($entity->getProperties() as $property) {
130
+        foreach ($entity->getProperties() as $property) {
131 131
             $name = $property->getName();
132
-            if($value = $request->get($name)) {
132
+            if ($value = $request->get($name)) {
133 133
                 $builder->andWhere($builder->expr()->orX(
134 134
                     $builder->expr()->like('e.'.$name, ':value')
135 135
                 ));
Please login to merge, or discard this patch.