@@ -28,7 +28,7 @@ |
||
| 28 | 28 | $finder = Finder::create() |
| 29 | 29 | ->name('*.module.php') |
| 30 | 30 | ->in(__DIR__.'/autoload'); |
| 31 | -foreach($finder->files() as $file){ |
|
| 31 | +foreach ($finder->files() as $file) { |
|
| 32 | 32 | $modules = array_merge($modules, include $file); |
| 33 | 33 | } |
| 34 | 34 | |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | $this->options = array_intersect_key($new, $this->options); |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | - public function toJsonLd($default=[]) |
|
| 60 | + public function toJsonLd($default = []) |
|
| 61 | 61 | { |
| 62 | 62 | $organization = $this->job->getOrganization(); |
| 63 | 63 | $organizationName = $organization ? $organization->getOrganizationName()->getName() : $this->job->getCompany(); |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | 'hiringOrganization' => [ |
| 88 | 88 | '@type' => 'Organization', |
| 89 | 89 | 'name' => $organizationName, |
| 90 | - 'logo' => $logo ? rtrim($this->options['server_url'], '/') . $logo : '', |
|
| 90 | + 'logo' => $logo ? rtrim($this->options['server_url'], '/').$logo : '', |
|
| 91 | 91 | ], |
| 92 | 92 | 'jobLocation' => $this->getLocations($this->job->getLocations()), |
| 93 | 93 | 'employmentType' => $this->job->getClassifications()->getEmploymentTypes()->getValues(), |
@@ -107,10 +107,10 @@ discard block |
||
| 107 | 107 | private function getLogo() { |
| 108 | 108 | $organization = $this->job->getOrganization(); |
| 109 | 109 | |
| 110 | - if( |
|
| 110 | + if ( |
|
| 111 | 111 | is_null($organization) |
| 112 | 112 | || is_null($image = $organization->getImages()->get(ImageSet::THUMBNAIL)) |
| 113 | - ){ |
|
| 113 | + ) { |
|
| 114 | 114 | return $this->job->getLogoRef(); |
| 115 | 115 | } |
| 116 | 116 | return $image->getUri(); |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | */ |
| 126 | 126 | private function getLocations($locations) |
| 127 | 127 | { |
| 128 | - $array=[]; |
|
| 128 | + $array = []; |
|
| 129 | 129 | foreach ($locations as $location) { /* @var \Core\Entity\LocationInterface $location */ |
| 130 | 130 | array_push( |
| 131 | 131 | $array, |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | '@type' => 'Place', |
| 134 | 134 | 'address' => [ |
| 135 | 135 | '@type' => 'PostalAddress', |
| 136 | - 'streetAddress' => $location->getStreetname() .' '.$location->getStreetnumber(), |
|
| 136 | + 'streetAddress' => $location->getStreetname().' '.$location->getStreetnumber(), |
|
| 137 | 137 | 'postalCode' => $location->getPostalCode(), |
| 138 | 138 | 'addressLocality' => $location->getCity(), |
| 139 | 139 | 'addressCountry' => $location->getCountry(), |
@@ -157,9 +157,9 @@ discard block |
||
| 157 | 157 | $html = $values->getHtml(); |
| 158 | 158 | |
| 159 | 159 | if ($html) { |
| 160 | - $description=sprintf("%s", $values->getHtml() ); |
|
| 160 | + $description = sprintf("%s", $values->getHtml()); |
|
| 161 | 161 | } else { |
| 162 | - $description=sprintf( |
|
| 162 | + $description = sprintf( |
|
| 163 | 163 | "<p>%s</p>". |
| 164 | 164 | "<h1>%s</h1>". |
| 165 | 165 | "<h3>Requirements</h3><p>%s</p>". |
@@ -197,7 +197,7 @@ discard block |
||
| 197 | 197 | ]; |
| 198 | 198 | } |
| 199 | 199 | |
| 200 | - private function getDefault(){ |
|
| 200 | + private function getDefault() { |
|
| 201 | 201 | return [ |
| 202 | 202 | '@context'=>'http://schema.org/', |
| 203 | 203 | '@type' => 'JobPosting', |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | public function __call($name, $args) |
| 57 | 57 | { |
| 58 | 58 | $args = array_map( |
| 59 | - function ($item) { |
|
| 59 | + function($item) { |
|
| 60 | 60 | if (is_object($item)) { return 'object'; } |
| 61 | 61 | return $item; |
| 62 | 62 | }, |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | ->willReturn($jobRepo); |
| 80 | 80 | $event->expects($this->exactly(2)) |
| 81 | 81 | ->method('getParam') |
| 82 | - ->withConsecutive(['days',80],['limit', 0]) |
|
| 82 | + ->withConsecutive(['days', 80], ['limit', 0]) |
|
| 83 | 83 | ->willReturnOnConsecutiveCalls(30, 10) |
| 84 | 84 | ; |
| 85 | 85 | |
@@ -77,13 +77,13 @@ discard block |
||
| 77 | 77 | $imageSetID = $organization->getImages()->getId(); |
| 78 | 78 | $images = $imageSet->createImages($options->getImages(), $data); |
| 79 | 79 | |
| 80 | - if(!is_dir($tmpDir)){ |
|
| 80 | + if (!is_dir($tmpDir)) { |
|
| 81 | 81 | mkdir($tmpDir, 0777, true); |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | $organization->getImages()->clear(); |
| 85 | - foreach($images as $key => $image){ |
|
| 86 | - $name = $key.'-'. $data['name']; |
|
| 85 | + foreach ($images as $key => $image) { |
|
| 86 | + $name = $key.'-'.$data['name']; |
|
| 87 | 87 | $format = str_replace('image/', '', $data['type']); |
| 88 | 88 | $content = $image->get($format); |
| 89 | 89 | $tmpFile = $tmpDir.DIRECTORY_SEPARATOR.md5($image->get($format)); |
@@ -94,12 +94,12 @@ discard block |
||
| 94 | 94 | $metadata->setOrganization($organization); |
| 95 | 95 | $metadata->setKey($key); |
| 96 | 96 | $metadata->setContentType($data['type']); |
| 97 | - if(!is_null($user)){ |
|
| 97 | + if (!is_null($user)) { |
|
| 98 | 98 | $metadata->setUser($user); |
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | /* @var ImageInterface $file */ |
| 102 | - $file = $fileManager->uploadFromFile($options->getEntityClass(),$metadata, $tmpFile, $name); |
|
| 102 | + $file = $fileManager->uploadFromFile($options->getEntityClass(), $metadata, $tmpFile, $name); |
|
| 103 | 103 | $organization->getImages()->add($file); |
| 104 | 104 | } |
| 105 | 105 | |
@@ -57,9 +57,9 @@ |
||
| 57 | 57 | foreach ($document->getAttachments() as $attachment) { |
| 58 | 58 | /* @var \Applications\Entity\Attachment $attachment */ |
| 59 | 59 | $attachment->getMetadata() |
| 60 | - ->getPermissions() |
|
| 61 | - ->clear() |
|
| 62 | - ->inherit($permissions); |
|
| 60 | + ->getPermissions() |
|
| 61 | + ->clear() |
|
| 62 | + ->inherit($permissions); |
|
| 63 | 63 | if ($isUpdate) { |
| 64 | 64 | $uow->computeChangeSet( |
| 65 | 65 | $dm->getClassMetadata(get_class($attachment)), |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | $attachment = $this->doUploadFile($application, $info); |
| 89 | 89 | |
| 90 | 90 | // remove existing image |
| 91 | - if(!is_null($application->getContact()->getImage())){ |
|
| 91 | + if (!is_null($application->getContact()->getImage())) { |
|
| 92 | 92 | $image = $application->getContact()->getImage(); |
| 93 | 93 | $application->getContact()->setImage(null); |
| 94 | 94 | $dm->remove($image); |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | $metadata->setContentType($info['type']); |
| 117 | 117 | $metadata->setName($info['name']); |
| 118 | 118 | |
| 119 | - if(!is_null($user)){ |
|
| 119 | + if (!is_null($user)) { |
|
| 120 | 120 | $this->dm->persist($user); |
| 121 | 121 | } |
| 122 | 122 | return $fileManager->uploadFromFile( |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | $name = "\\$namespace\\Entity\\$entityName"; |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | - $repository = $this->dm->getRepository($name); |
|
| 41 | + $repository = $this->dm->getRepository($name); |
|
| 42 | 42 | |
| 43 | 43 | if (!$repository instanceof AbstractRepository) { |
| 44 | 44 | $eventArgs = new DoctrineMongoODM\Event\EventArgs( |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | |
| 67 | 67 | public function flush($entity = null, array $options = array()) |
| 68 | 68 | { |
| 69 | - if(!is_null($entity)){ |
|
| 69 | + if (!is_null($entity)) { |
|
| 70 | 70 | $this->dm->persist($entity); |
| 71 | 71 | $this->dm->flush(); |
| 72 | 72 | } |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | && $events->dispatchEvent('postCommit', new EventArgs(array('document' => $entity, 'documentManager' => $this->dm))); |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | - public function remove(EntityInterface $entity, $flush=false) |
|
| 78 | + public function remove(EntityInterface $entity, $flush = false) |
|
| 79 | 79 | { |
| 80 | 80 | $dm = $this->dm; |
| 81 | 81 | $events = $dm->getEventManager(); |
@@ -81,12 +81,12 @@ discard block |
||
| 81 | 81 | { |
| 82 | 82 | $repo = $this->getRepository($entityClass); |
| 83 | 83 | |
| 84 | - if(UserImage::class !== $entityClass && is_null($metadata->getUser())){ |
|
| 84 | + if (UserImage::class !== $entityClass && is_null($metadata->getUser())) { |
|
| 85 | 85 | $user = $this->auth->getUser(); |
| 86 | 86 | |
| 87 | - if($user instanceof AnonymousUser){ |
|
| 87 | + if ($user instanceof AnonymousUser) { |
|
| 88 | 88 | $metadata->getPermissions()->grant($user, PermissionsInterface::PERMISSION_ALL); |
| 89 | - }else{ |
|
| 89 | + } else { |
|
| 90 | 90 | $this->dm->getUnitOfWork()->registerManaged($user, $user->getId(), []); |
| 91 | 91 | |
| 92 | 92 | $metadata->setUser($user); |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | $events->hasListeners('postRemoveEntity') && |
| 127 | 127 | $events->dispatchEvent('postRemoveEntity', new LifecycleEventArgs($file, $dm)); |
| 128 | 128 | |
| 129 | - if($andFlush){ |
|
| 129 | + if ($andFlush) { |
|
| 130 | 130 | $dm->flush(); |
| 131 | 131 | } |
| 132 | 132 | } |
@@ -86,7 +86,7 @@ |
||
| 86 | 86 | |
| 87 | 87 | if($user instanceof AnonymousUser){ |
| 88 | 88 | $metadata->getPermissions()->grant($user, PermissionsInterface::PERMISSION_ALL); |
| 89 | - }else{ |
|
| 89 | + } else{ |
|
| 90 | 90 | $this->dm->getUnitOfWork()->registerManaged($user, $user->getId(), []); |
| 91 | 91 | |
| 92 | 92 | $metadata->setUser($user); |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | list($module, $entityName) = explode('.', $fileStoreName); |
| 76 | 76 | $response = $this->getResponse(); |
| 77 | 77 | $fileManager = $this->fileManager; |
| 78 | - $entityClass = $module . '\\Entity\\' . $entityName; |
|
| 78 | + $entityClass = $module.'\\Entity\\'.$entityName; |
|
| 79 | 79 | $fileId = $this->params('fileId', 0); |
| 80 | 80 | |
| 81 | 81 | if (preg_match('/^(.*)\..*$/', $fileId, $baseFileName)) { |
@@ -149,11 +149,11 @@ discard block |
||
| 149 | 149 | $events = $this->coreFileEvents; |
| 150 | 150 | $event = $events->getEvent(FileEvent::EVENT_DELETE, $this, ['file' => $file]); |
| 151 | 151 | |
| 152 | - $results = $events->triggerEventUntil(function ($r) { |
|
| 152 | + $results = $events->triggerEventUntil(function($r) { |
|
| 153 | 153 | return true === $r; |
| 154 | 154 | }, $event); |
| 155 | 155 | |
| 156 | - if(true !== $results->last()){ |
|
| 156 | + if (true !== $results->last()) { |
|
| 157 | 157 | $this->fileManager->remove($file, true); |
| 158 | 158 | } |
| 159 | 159 | |