@@ -26,6 +26,6 @@ |
||
| 26 | 26 | $repositories = $container->get('repositories'); |
| 27 | 27 | $coreFileEvents = $container->get('Core/File/Events'); |
| 28 | 28 | |
| 29 | - return new FileController($repositories,$coreFileEvents); |
|
| 29 | + return new FileController($repositories, $coreFileEvents); |
|
| 30 | 30 | } |
| 31 | 31 | } |
@@ -103,9 +103,9 @@ discard block |
||
| 103 | 103 | public function iHaveOrganization($name) |
| 104 | 104 | { |
| 105 | 105 | $user = $this->getUserContext()->getCurrentUser(); |
| 106 | - $organization = $this->findOrganizationByName($name,false); |
|
| 106 | + $organization = $this->findOrganizationByName($name, false); |
|
| 107 | 107 | $repo = $this->getRepository('Organizations/Organization'); |
| 108 | - if(!$organization instanceof Organization){ |
|
| 108 | + if (!$organization instanceof Organization) { |
|
| 109 | 109 | |
| 110 | 110 | $organization = new Organization(); |
| 111 | 111 | $organizationName = new OrganizationName($name); |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | $organization->setParent($parent); |
| 119 | 119 | $organization->setProfileSetting(Organization::PROFILE_ALWAYS_ENABLE); |
| 120 | 120 | $permissions = $organization->getPermissions(); |
| 121 | - $permissions->grant($user,Permissions::PERMISSION_ALL); |
|
| 121 | + $permissions->grant($user, Permissions::PERMISSION_ALL); |
|
| 122 | 122 | |
| 123 | 123 | $repo->store($organization); |
| 124 | 124 | $repo->getDocumentManager()->refresh($organization); |
@@ -128,19 +128,19 @@ discard block |
||
| 128 | 128 | /** |
| 129 | 129 | * @Given organization :name have jobs: |
| 130 | 130 | */ |
| 131 | - public function organizationHavePublishedJob($name,TableNode $table) |
|
| 131 | + public function organizationHavePublishedJob($name, TableNode $table) |
|
| 132 | 132 | { |
| 133 | 133 | $user = $this->getUserContext()->getCurrentUser(); |
| 134 | - if(is_null($user)){ |
|
| 134 | + if (is_null($user)) { |
|
| 135 | 135 | throw new FailedExpectationException('Need to login first'); |
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 | $organization = $this->findOrganizationByName($name); |
| 139 | - foreach($table->getColumnsHash() as $index=>$definitions){ |
|
| 139 | + foreach ($table->getColumnsHash() as $index=>$definitions) { |
|
| 140 | 140 | $definitions['user'] = $user->getLogin(); |
| 141 | - $status = isset($definitions['status']) ? $definitions['status']:'draft'; |
|
| 141 | + $status = isset($definitions['status']) ? $definitions['status'] : 'draft'; |
|
| 142 | 142 | unset($definitions['status']); |
| 143 | - $this->jobContext->buildJob($status,$definitions,$organization); |
|
| 143 | + $this->jobContext->buildJob($status, $definitions, $organization); |
|
| 144 | 144 | } |
| 145 | 145 | } |
| 146 | 146 | |
@@ -149,7 +149,7 @@ discard block |
||
| 149 | 149 | * @param $name |
| 150 | 150 | * @param $setting |
| 151 | 151 | */ |
| 152 | - public function profileSetting($name,$setting) |
|
| 152 | + public function profileSetting($name, $setting) |
|
| 153 | 153 | { |
| 154 | 154 | $repo = $this->getRepository('Organizations/Organization'); |
| 155 | 155 | $organization = $this->findOrganizationByName($name); |
@@ -169,12 +169,12 @@ discard block |
||
| 169 | 169 | $contact = $organization->getContact(); |
| 170 | 170 | |
| 171 | 171 | $definitions = $table->getRowsHash(); |
| 172 | - foreach($definitions as $name=>$value){ |
|
| 172 | + foreach ($definitions as $name=>$value) { |
|
| 173 | 173 | $field = Inflector::camelize($name); |
| 174 | 174 | $method = 'set'.$field; |
| 175 | - $callback = array($contact,$method); |
|
| 176 | - if(is_callable($callback)){ |
|
| 177 | - call_user_func_array($callback,[$value]); |
|
| 175 | + $callback = array($contact, $method); |
|
| 176 | + if (is_callable($callback)) { |
|
| 177 | + call_user_func_array($callback, [$value]); |
|
| 178 | 178 | } |
| 179 | 179 | } |
| 180 | 180 | $this->getRepository('Organizations/Organization')->store($organization); |
@@ -186,14 +186,14 @@ discard block |
||
| 186 | 186 | * @param string $name |
| 187 | 187 | * @throws FailedExpectationException |
| 188 | 188 | */ |
| 189 | - public function iGoToOrganizationProfilePage($name=null) |
|
| 189 | + public function iGoToOrganizationProfilePage($name = null) |
|
| 190 | 190 | { |
| 191 | - if(is_null($name)){ |
|
| 191 | + if (is_null($name)) { |
|
| 192 | 192 | $organization = $this->getUserContext()->getCurrentUser()->getOrganization()->getOrganization(); |
| 193 | - }else{ |
|
| 193 | + } else { |
|
| 194 | 194 | $organization = $this->findOrganizationByName($name); |
| 195 | 195 | } |
| 196 | - $url = $this->buildUrl('lang/organizations/profileDetail',[ |
|
| 196 | + $url = $this->buildUrl('lang/organizations/profileDetail', [ |
|
| 197 | 197 | 'id' => $organization->getId() |
| 198 | 198 | ]); |
| 199 | 199 | |
@@ -210,10 +210,10 @@ discard block |
||
| 210 | 210 | /* @var OrganizationRepository $repo */ |
| 211 | 211 | $repo = $this->getRepository('Organizations/Organization'); |
| 212 | 212 | $result = $repo->findByName($name); |
| 213 | - $organization = count($result) > 0 ? $result[0]:null; |
|
| 214 | - if(!$organization instanceof Organization && $throwException){ |
|
| 213 | + $organization = count($result) > 0 ? $result[0] : null; |
|
| 214 | + if (!$organization instanceof Organization && $throwException) { |
|
| 215 | 215 | throw new FailedExpectationException( |
| 216 | - sprintf('Organization %s is not found.',$name) |
|
| 216 | + sprintf('Organization %s is not found.', $name) |
|
| 217 | 217 | ); |
| 218 | 218 | } |
| 219 | 219 | return $organization; |
@@ -232,8 +232,8 @@ discard block |
||
| 232 | 232 | $jobRepo = $this->getRepository('Jobs/Job'); |
| 233 | 233 | $result = $jobRepo->findByOrganization($org->getId()); |
| 234 | 234 | |
| 235 | - foreach($result as $job){ |
|
| 236 | - $jobRepo->remove($job,true); |
|
| 235 | + foreach ($result as $job) { |
|
| 236 | + $jobRepo->remove($job, true); |
|
| 237 | 237 | } |
| 238 | 238 | } |
| 239 | 239 | |
@@ -244,7 +244,7 @@ discard block |
||
| 244 | 244 | { |
| 245 | 245 | $user = $this->getUserContext()->getCurrentUser(); |
| 246 | 246 | $organization = $user->getOrganization()->getOrganization(); |
| 247 | - $url = $this->buildUrl('lang/organizations/edit',['id' => $organization->getId()]); |
|
| 247 | + $url = $this->buildUrl('lang/organizations/edit', ['id' => $organization->getId()]); |
|
| 248 | 248 | $this->visit($url); |
| 249 | 249 | } |
| 250 | 250 | |
@@ -255,7 +255,7 @@ discard block |
||
| 255 | 255 | public function iAttachLogoFromFile($file) |
| 256 | 256 | { |
| 257 | 257 | $elementId = 'organizationLogo-original'; |
| 258 | - $this->minkContext->attachFileToField($elementId,$file); |
|
| 258 | + $this->minkContext->attachFileToField($elementId, $file); |
|
| 259 | 259 | } |
| 260 | 260 | |
| 261 | 261 | /** |
@@ -264,7 +264,7 @@ discard block |
||
| 264 | 264 | public function iRemoveLogoFromOrganization() |
| 265 | 265 | { |
| 266 | 266 | $elementId = '#organizationLogo-original-delete'; |
| 267 | - $element = $this->minkContext->getSession()->getPage()->find('css',$elementId); |
|
| 267 | + $element = $this->minkContext->getSession()->getPage()->find('css', $elementId); |
|
| 268 | 268 | $element->click(); |
| 269 | 269 | } |
| 270 | 270 | } |