@@ -43,12 +43,12 @@ |
||
43 | 43 | '@testGetFilesAppendsContactImage' => UfpsMock::class, |
44 | 44 | ]; |
45 | 45 | |
46 | - private $inheritance = [ AbstractUpdateFilesPermissionsSubscriber::class ]; |
|
46 | + private $inheritance = [AbstractUpdateFilesPermissionsSubscriber::class]; |
|
47 | 47 | |
48 | 48 | public function testDefaultAttributesValues() |
49 | 49 | { |
50 | 50 | $this->assertAttributeEquals(Cv::class, 'targetDocument', $this->target); |
51 | - $this->assertAttributeEquals([ 'attachments' ], 'filesProperties', $this->target); |
|
51 | + $this->assertAttributeEquals(['attachments'], 'filesProperties', $this->target); |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | /* |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | 'getTargetArgs', |
40 | 40 | ]; |
41 | 41 | |
42 | - private $inheritance = [ AbstractPaginationQuery::class ]; |
|
42 | + private $inheritance = [AbstractPaginationQuery::class]; |
|
43 | 43 | |
44 | 44 | private function getTargetArgs() |
45 | 45 | { |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | } |
61 | 61 | |
62 | 62 | $this->user = $user; |
63 | - return [ $user ]; |
|
63 | + return [$user]; |
|
64 | 64 | } |
65 | 65 | |
66 | 66 | public function testDefaultPropertyValues() |
@@ -92,29 +92,29 @@ discard block |
||
92 | 92 | $exprExpects = []; |
93 | 93 | |
94 | 94 | if ('search' == $mode || true === $mode) { |
95 | - $exprExpects['operator'][] = [ 'with' => ['$text', ['$search' => strtolower($params['search'])]]]; |
|
96 | - $exprExpects['getQuery'][] = [ 'return' => ['exprQuery'] ]; |
|
97 | - $qbExpects['field'][] = [ 'with' => [""]]; |
|
98 | - $qbExpects['equals'][] = [ 'with' => [['exprQuery']]]; |
|
95 | + $exprExpects['operator'][] = ['with' => ['$text', ['$search' => strtolower($params['search'])]]]; |
|
96 | + $exprExpects['getQuery'][] = ['return' => ['exprQuery']]; |
|
97 | + $qbExpects['field'][] = ['with' => [""]]; |
|
98 | + $qbExpects['equals'][] = ['with' => [['exprQuery']]]; |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | if ('location' == $mode || true === $mode) { |
102 | 102 | $coords = $params['l']->getCoordinates()->getCoordinates(); |
103 | 103 | $qbExpects['field'][] = ['with' => ['preferredJob.desiredLocations.coordinates']]; |
104 | - $qbExpects['geoWithinCenter'][] = ['with' => [$coords[0], $coords[1],(float)$params['d'] / 100]]; |
|
104 | + $qbExpects['geoWithinCenter'][] = ['with' => [$coords[0], $coords[1], (float) $params['d'] / 100]]; |
|
105 | 105 | } |
106 | 106 | |
107 | - $exprExpects['field'][] = [ 'with' => ['permissions.view']]; |
|
108 | - $exprExpects['equals'][] = [ 'with' => [ $this->user->getId()]]; |
|
109 | - $exprExpects['field'][] = [ 'with' => ['status.name']]; |
|
110 | - $exprExpects['equals'][] = [ 'with' => [Status::PUBLIC_TO_ALL]]; |
|
107 | + $exprExpects['field'][] = ['with' => ['permissions.view']]; |
|
108 | + $exprExpects['equals'][] = ['with' => [$this->user->getId()]]; |
|
109 | + $exprExpects['field'][] = ['with' => ['status.name']]; |
|
110 | + $exprExpects['equals'][] = ['with' => [Status::PUBLIC_TO_ALL]]; |
|
111 | 111 | |
112 | - $qbExpects['addOr'][] = [ 'with' => [$expr] ]; |
|
113 | - $qbExpects['addOr'][] = [ 'with' => [$expr] ]; |
|
112 | + $qbExpects['addOr'][] = ['with' => [$expr]]; |
|
113 | + $qbExpects['addOr'][] = ['with' => [$expr]]; |
|
114 | 114 | |
115 | 115 | |
116 | 116 | |
117 | - $configureMock = function ($mock, $expects) { |
|
117 | + $configureMock = function($mock, $expects) { |
|
118 | 118 | foreach ($expects as $method => $spec) { |
119 | 119 | $count = count($spec); |
120 | 120 | $with = []; |
@@ -141,14 +141,14 @@ discard block |
||
141 | 141 | public function provideCreateQueryTestData() |
142 | 142 | { |
143 | 143 | $loc = new Location(); |
144 | - $loc->setCoordinates(new Point([1,1])); |
|
144 | + $loc->setCoordinates(new Point([1, 1])); |
|
145 | 145 | return [ |
146 | - 'woParams' => [ null, null ], |
|
147 | - 'emptySearch' => [ null, ['search' => '']], |
|
148 | - 'search' => [ 'search', ['search' => 'MusBeLowerCase']], |
|
149 | - 'emptyLocation' => [ null, ['l' => new Location()]], |
|
150 | - 'location' => [ 'location', ['l' => $loc, 'd' => 10]], |
|
151 | - 'all' => [ true, ['search' => 'MustLowerThisOneToo', 'l' => $loc, 'd' => 5]], |
|
146 | + 'woParams' => [null, null], |
|
147 | + 'emptySearch' => [null, ['search' => '']], |
|
148 | + 'search' => ['search', ['search' => 'MusBeLowerCase']], |
|
149 | + 'emptyLocation' => [null, ['l' => new Location()]], |
|
150 | + 'location' => ['location', ['l' => $loc, 'd' => 10]], |
|
151 | + 'all' => [true, ['search' => 'MustLowerThisOneToo', 'l' => $loc, 'd' => 5]], |
|
152 | 152 | |
153 | 153 | ]; |
154 | 154 | } |
@@ -165,7 +165,7 @@ |
||
165 | 165 | $metadata = new ImageMetadata(); |
166 | 166 | |
167 | 167 | $contact = $cv->getContact(); |
168 | - if(!is_null($contact->getImage())){ |
|
168 | + if (!is_null($contact->getImage())) { |
|
169 | 169 | $contact->setImage(null); |
170 | 170 | $dm->persist($cv); |
171 | 171 | $dm->flush(); |
@@ -106,11 +106,11 @@ discard block |
||
106 | 106 | $viewHelperManager = $this->viewHelper; |
107 | 107 | $uploadHandler = $this->uploadHandler; |
108 | 108 | |
109 | - if('image' === $formId){ |
|
109 | + if ('image' === $formId) { |
|
110 | 110 | // handles image upload |
111 | 111 | $uploadHandler->handleImageUpload($cv, $_FILES['image']); |
112 | 112 | } |
113 | - elseif('attachments' === $formId){ |
|
113 | + elseif ('attachments' === $formId) { |
|
114 | 114 | // handles attachment upload |
115 | 115 | $attachment = $uploadHandler->handleAttachmentUpload($cv, $_FILES['attachments']); |
116 | 116 | $content = $viewHelperManager->get('basepath') |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | 'content' => $content, |
121 | 121 | ]); |
122 | 122 | } |
123 | - else{ |
|
123 | + else { |
|
124 | 124 | if (!$form->isValid()) { |
125 | 125 | return new JsonModel([ |
126 | 126 | 'valid' => false, |
@@ -109,8 +109,7 @@ discard block |
||
109 | 109 | if('image' === $formId){ |
110 | 110 | // handles image upload |
111 | 111 | $uploadHandler->handleImageUpload($cv, $_FILES['image']); |
112 | - } |
|
113 | - elseif('attachments' === $formId){ |
|
112 | + } elseif('attachments' === $formId){ |
|
114 | 113 | // handles attachment upload |
115 | 114 | $attachment = $uploadHandler->handleAttachmentUpload($cv, $_FILES['attachments']); |
116 | 115 | $content = $viewHelperManager->get('basepath') |
@@ -119,8 +118,7 @@ discard block |
||
119 | 118 | 'valid' => true, |
120 | 119 | 'content' => $content, |
121 | 120 | ]); |
122 | - } |
|
123 | - else{ |
|
121 | + } else{ |
|
124 | 122 | if (!$form->isValid()) { |
125 | 123 | return new JsonModel([ |
126 | 124 | 'valid' => false, |
@@ -34,6 +34,6 @@ |
||
34 | 34 | */ |
35 | 35 | public function getUri(): string |
36 | 36 | { |
37 | - return "/file/Cv.Attachment/" . $this->getId() . "/" .urlencode($this->getMetadata()->getName()); |
|
37 | + return "/file/Cv.Attachment/".$this->getId()."/".urlencode($this->getMetadata()->getName()); |
|
38 | 38 | } |
39 | 39 | } |
@@ -32,6 +32,6 @@ |
||
32 | 32 | */ |
33 | 33 | public function getUri(): string |
34 | 34 | { |
35 | - return "/file/Cv.ContactImage/" . $this->id . "/" .urlencode($this->name); |
|
35 | + return "/file/Cv.ContactImage/".$this->id."/".urlencode($this->name); |
|
36 | 36 | } |
37 | 37 | } |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | { |
23 | 23 | $this->addFilter( |
24 | 24 | 'ignoreInternalProperties', |
25 | - function ($property) { |
|
25 | + function($property) { |
|
26 | 26 | return "_" != $property[0]; |
27 | 27 | } |
28 | 28 | ); |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | if (!$this->filterComposite->filter($propertyName)) { |
43 | 43 | continue; |
44 | 44 | } |
45 | - $getter = 'get' . ucfirst($propertyName); |
|
45 | + $getter = 'get'.ucfirst($propertyName); |
|
46 | 46 | $value = method_exists($object, $getter) |
47 | 47 | ? $object->$getter() |
48 | 48 | : $property->getValue($object); |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | foreach ($data as $key => $value) { |
65 | 65 | if (isset($reflProperties[$key])) { |
66 | 66 | $value = $this->hydrateValue($key, $value); |
67 | - $setter = 'set' . ucfirst($key); |
|
67 | + $setter = 'set'.ucfirst($key); |
|
68 | 68 | if (method_exists($object, $setter)) { |
69 | 69 | $object->$setter($value); |
70 | 70 | } else { |
@@ -21,7 +21,7 @@ |
||
21 | 21 | $ob = $handler->findOrCreate(new TestMigrator(), false); |
22 | 22 | $dm = $this->getDoctrine(); |
23 | 23 | |
24 | - if(!is_null($ob)){ |
|
24 | + if (!is_null($ob)) { |
|
25 | 25 | $dm->remove($ob); |
26 | 26 | $dm->flush(); |
27 | 27 | } |
@@ -57,7 +57,7 @@ |
||
57 | 57 | |
58 | 58 | $bucket = $this->getBucket('test'); |
59 | 59 | $cursor = $bucket->find(); |
60 | - foreach($cursor as $current){ |
|
60 | + foreach ($cursor as $current) { |
|
61 | 61 | $this->assertFileMigrated($current); |
62 | 62 | } |
63 | 63 | } |