@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | * @throws Mapping\MappingException |
53 | 53 | * @throws LockException |
54 | 54 | * @throws UserDeactivatedException |
55 | - * @return null | UserInterface |
|
55 | + * @return null|UserInterface | UserInterface |
|
56 | 56 | */ |
57 | 57 | public function find($id, $lockMode = \Doctrine\ODM\MongoDB\LockMode::NONE, $lockVersion = null, array $options = []) |
58 | 58 | { |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | * @param array $criteria |
64 | 64 | * @param array $options |
65 | 65 | * @throws UserDeactivatedException |
66 | - * @return null | UserInterface |
|
66 | + * @return null|UserInterface | UserInterface |
|
67 | 67 | */ |
68 | 68 | public function findOneBy(array $criteria, array $options = []) |
69 | 69 | { |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | * Creates a User |
93 | 93 | * |
94 | 94 | * @see \Core\Repository\AbstractRepository::create() |
95 | - * @return UserInterface |
|
95 | + * @return \Core\Entity\EntityInterface |
|
96 | 96 | */ |
97 | 97 | public function create(array $data = null, $persist=false) |
98 | 98 | { |
@@ -267,7 +267,7 @@ discard block |
||
267 | 267 | * @param UserInterface $user |
268 | 268 | * @param array $options |
269 | 269 | * @throws UserDeactivatedException |
270 | - * @return null | UserInterface |
|
270 | + * @return null|UserInterface | UserInterface |
|
271 | 271 | */ |
272 | 272 | protected function assertEntity(UserInterface $user = null, array $options) |
273 | 273 | { |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | * @see \Core\Repository\AbstractRepository::create() |
95 | 95 | * @return UserInterface |
96 | 96 | */ |
97 | - public function create(array $data = null, $persist=false) |
|
97 | + public function create(array $data = null, $persist = false) |
|
98 | 98 | { |
99 | 99 | $entity = parent::create($data); |
100 | 100 | |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | */ |
117 | 117 | public function findByProfileIdentifier($identifier, $provider, array $options = []) |
118 | 118 | { |
119 | - return $this->findOneBy(array('profiles.' . $provider . '.auth.identifier' => $identifier), $options) ?: $this->findOneBy(array('profile.identifier' => $identifier), $options); |
|
119 | + return $this->findOneBy(array('profiles.'.$provider.'.auth.identifier' => $identifier), $options) ?: $this->findOneBy(array('profile.identifier' => $identifier), $options); |
|
120 | 120 | } |
121 | 121 | |
122 | 122 | /** |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | $qb->field('_id')->notEqual($curentUserId) |
134 | 134 | ->addAnd( |
135 | 135 | $qb->expr() |
136 | - ->addOr($qb->expr()->field('profiles.' . $provider . '.auth.identifier' )->equals($identifier)) |
|
136 | + ->addOr($qb->expr()->field('profiles.'.$provider.'.auth.identifier')->equals($identifier)) |
|
137 | 137 | ->addOr($qb->expr()->field('profile.identifier')->equals($identifier)) |
138 | 138 | ); |
139 | 139 | |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | return $this->findOneBy( |
190 | 190 | array( |
191 | 191 | '$or' => array( |
192 | - array('login' => $identity . $suffix), |
|
192 | + array('login' => $identity.$suffix), |
|
193 | 193 | array('info.email' => $identity) |
194 | 194 | ) |
195 | 195 | ) |
@@ -238,10 +238,10 @@ discard block |
||
238 | 238 | public function findByQuery($query) |
239 | 239 | { |
240 | 240 | $qb = $this->createQueryBuilder(); |
241 | - $parts = explode(' ', trim($query)); |
|
241 | + $parts = explode(' ', trim($query)); |
|
242 | 242 | |
243 | 243 | foreach ($parts as $q) { |
244 | - $regex = new \MongoRegex('/^' . $query . '/i'); |
|
244 | + $regex = new \MongoRegex('/^'.$query.'/i'); |
|
245 | 245 | $qb->addOr($qb->expr()->field('info.firstName')->equals($regex)); |
246 | 246 | $qb->addOr($qb->expr()->field('info.lastName')->equals($regex)); |
247 | 247 | $qb->addOr($qb->expr()->field('info.email')->equals($regex)); |
@@ -129,10 +129,10 @@ discard block |
||
129 | 129 | // ) |
130 | 130 | // ); |
131 | 131 | $qb->addAnd($qb->expr()->field('user')->equals($userId)) |
132 | - ->addAnd( |
|
133 | - $qb->expr()->addOr($qb->expr()->field('parent')->exists(false)) |
|
134 | - ->addOr($qb->expr()->field('parent')->equals(null)) |
|
135 | - ); |
|
132 | + ->addAnd( |
|
133 | + $qb->expr()->addOr($qb->expr()->field('parent')->exists(false)) |
|
134 | + ->addOr($qb->expr()->field('parent')->equals(null)) |
|
135 | + ); |
|
136 | 136 | |
137 | 137 | $q = $qb->getQuery(); |
138 | 138 | $entity = $q->getSingleResult(); |
@@ -192,11 +192,11 @@ discard block |
||
192 | 192 | return $c; |
193 | 193 | } |
194 | 194 | |
195 | - /** |
|
196 | - * @param array|null $data |
|
197 | - * @param bool $persist |
|
198 | - * @return \Organizations\Entity\Organization |
|
199 | - */ |
|
195 | + /** |
|
196 | + * @param array|null $data |
|
197 | + * @param bool $persist |
|
198 | + * @return \Organizations\Entity\Organization |
|
199 | + */ |
|
200 | 200 | public function create(array $data = null, $persist=false) |
201 | 201 | { |
202 | 202 | $entity = parent::create($data); |
@@ -197,7 +197,7 @@ |
||
197 | 197 | * @param bool $persist |
198 | 198 | * @return \Organizations\Entity\Organization |
199 | 199 | */ |
200 | - public function create(array $data = null, $persist=false) |
|
200 | + public function create(array $data = null, $persist = false) |
|
201 | 201 | { |
202 | 202 | $entity = parent::create($data); |
203 | 203 | $entity->isDraft(true); |
@@ -80,9 +80,9 @@ |
||
80 | 80 | $repo->setEntityPrototype(new User()); |
81 | 81 | |
82 | 82 | $result = true; |
83 | - try{ |
|
83 | + try { |
|
84 | 84 | $repo->store($user); |
85 | - }catch (\Exception $e){ |
|
85 | + } catch (\Exception $e) { |
|
86 | 86 | throw $e; |
87 | 87 | } |
88 | 88 | return $result; |
@@ -82,7 +82,7 @@ |
||
82 | 82 | $result = true; |
83 | 83 | try{ |
84 | 84 | $repo->store($user); |
85 | - }catch (\Exception $e){ |
|
85 | + } catch (\Exception $e){ |
|
86 | 86 | throw $e; |
87 | 87 | } |
88 | 88 | return $result; |
@@ -114,13 +114,13 @@ discard block |
||
114 | 114 | |
115 | 115 | $data = $form->getData(); |
116 | 116 | |
117 | - try{ |
|
117 | + try { |
|
118 | 118 | $options = [ |
119 | 119 | 'connection' => $data['db_conn'], |
120 | 120 | ]; |
121 | - $userOk = $this->plugin('Install/UserCreator',$options)->process($data['username'], $data['password'], $data['email']); |
|
121 | + $userOk = $this->plugin('Install/UserCreator', $options)->process($data['username'], $data['password'], $data['email']); |
|
122 | 122 | $ok = $this->plugin('Install/ConfigCreator')->process($data['db_conn'], $data['email']); |
123 | - }catch (\Exception $exception){ |
|
123 | + } catch (\Exception $exception) { |
|
124 | 124 | /* @TODO: provide a way to handle global error message */ |
125 | 125 | return $this->createJsonResponse([ |
126 | 126 | 'ok' => false, |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | parent::attachDefaultListeners(); |
154 | 154 | |
155 | 155 | $events = $this->getEventManager(); |
156 | - $events->attach( MvcEvent::EVENT_DISPATCH, array( $this, 'preDispatch' ), 100 ); |
|
156 | + $events->attach(MvcEvent::EVENT_DISPATCH, array($this, 'preDispatch'), 100); |
|
157 | 157 | } |
158 | 158 | |
159 | 159 | /** |
@@ -120,7 +120,7 @@ |
||
120 | 120 | ]; |
121 | 121 | $userOk = $this->plugin('Install/UserCreator',$options)->process($data['username'], $data['password'], $data['email']); |
122 | 122 | $ok = $this->plugin('Install/ConfigCreator')->process($data['db_conn'], $data['email']); |
123 | - }catch (\Exception $exception){ |
|
123 | + } catch (\Exception $exception){ |
|
124 | 124 | /* @TODO: provide a way to handle global error message */ |
125 | 125 | return $this->createJsonResponse([ |
126 | 126 | 'ok' => false, |
@@ -50,9 +50,9 @@ discard block |
||
50 | 50 | |
51 | 51 | $config = $container->get('doctrine.documentmanager.odm_default')->getConfiguration(); |
52 | 52 | $config->setDefaultDB($database); |
53 | - $dm = $this->createDocumentManager($options['connection'],$config); |
|
53 | + $dm = $this->createDocumentManager($options['connection'], $config); |
|
54 | 54 | |
55 | - $plugin = new UserCreator($credentialFilter,$dm); |
|
55 | + $plugin = new UserCreator($credentialFilter, $dm); |
|
56 | 56 | return $plugin; |
57 | 57 | } |
58 | 58 | |
@@ -64,10 +64,10 @@ discard block |
||
64 | 64 | * @return DocumentManager |
65 | 65 | * @codeCoverageIgnore |
66 | 66 | */ |
67 | - public function createDocumentManager($connection,$config) |
|
67 | + public function createDocumentManager($connection, $config) |
|
68 | 68 | { |
69 | 69 | $dbConn = new Connection($connection); |
70 | - $dm = DocumentManager::create($dbConn,$config); |
|
70 | + $dm = DocumentManager::create($dbConn, $config); |
|
71 | 71 | return $dm; |
72 | 72 | } |
73 | 73 | } |
@@ -81,7 +81,7 @@ |
||
81 | 81 | $this->error(self::NO_CONNECTION); |
82 | 82 | |
83 | 83 | return false; |
84 | - }catch (\Exception $e){ |
|
84 | + } catch (\Exception $e) { |
|
85 | 85 | $this->databaseError = $e->getMessage(); |
86 | 86 | $this->error(self::NO_CONNECTION); |
87 | 87 | return false; |
@@ -81,7 +81,7 @@ |
||
81 | 81 | $this->error(self::NO_CONNECTION); |
82 | 82 | |
83 | 83 | return false; |
84 | - }catch (\Exception $e){ |
|
84 | + } catch (\Exception $e){ |
|
85 | 85 | $this->databaseError = $e->getMessage(); |
86 | 86 | $this->error(self::NO_CONNECTION); |
87 | 87 | return false; |
@@ -153,18 +153,18 @@ discard block |
||
153 | 153 | $replyTo = $this->stringFromMailHeader($this->getReplyTo()); |
154 | 154 | |
155 | 155 | return str_pad($template, 30) |
156 | - . 'to: ' . str_pad($to, 50) |
|
157 | - . 'cc: ' . str_pad($cc, 50) |
|
158 | - . 'bcc: ' . str_pad($bcc, 50) |
|
159 | - . 'from: ' . str_pad($from, 50) |
|
160 | - . 'replyTo: ' . str_pad($replyTo, 50) |
|
156 | + . 'to: '.str_pad($to, 50) |
|
157 | + . 'cc: '.str_pad($cc, 50) |
|
158 | + . 'bcc: '.str_pad($bcc, 50) |
|
159 | + . 'from: '.str_pad($from, 50) |
|
160 | + . 'replyTo: '.str_pad($replyTo, 50) |
|
161 | 161 | //. str_pad(implode(',', ArrayUtils::iteratorToArray($this->getSender())),50) |
162 | - . 'subject: ' . str_pad($this->getSubject(), 50); |
|
162 | + . 'subject: '.str_pad($this->getSubject(), 50); |
|
163 | 163 | } |
164 | 164 | |
165 | 165 | public function template($template) |
166 | 166 | { |
167 | - $controller = is_object($this->controller) ? get_class($this->controller):'null'; |
|
167 | + $controller = is_object($this->controller) ? get_class($this->controller) : 'null'; |
|
168 | 168 | |
169 | 169 | $event = new Event(); |
170 | 170 | $eventManager = $this->eventManager; |
@@ -181,11 +181,11 @@ discard block |
||
181 | 181 | $controllerIdentifier = strtolower(substr($controller, 0, strpos($controller, '\\'))); |
182 | 182 | $viewResolver = $this->viewResolver; |
183 | 183 | |
184 | - $templateHalf = 'mail/' . $template; |
|
184 | + $templateHalf = 'mail/'.$template; |
|
185 | 185 | $resource = $viewResolver->resolve($templateHalf); |
186 | 186 | |
187 | 187 | if (empty($resource)) { |
188 | - $templateFull = $controllerIdentifier . '/mail/' . $template; |
|
188 | + $templateFull = $controllerIdentifier.'/mail/'.$template; |
|
189 | 189 | $resource = $viewResolver->resolve($templateFull); |
190 | 190 | } |
191 | 191 | |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | unset($__vars[$key]); |
213 | 213 | } |
214 | 214 | } |
215 | - unset($__vars['content'],$__vars['controllerIdentifier'],$__vars['controller'],$__vars['resource'],$__vars['template'],$__vars['viewResolver']); |
|
215 | + unset($__vars['content'], $__vars['controllerIdentifier'], $__vars['controller'], $__vars['resource'], $__vars['template'], $__vars['viewResolver']); |
|
216 | 216 | $this->config = $__vars; |
217 | 217 | } |
218 | 218 | } |
@@ -237,20 +237,20 @@ discard block |
||
237 | 237 | if (isset($this->config['from'])) { |
238 | 238 | $from = $this->config['from']; |
239 | 239 | } else { |
240 | - $log->err('A from email address must be provided (Variable $from) in Template: ' . $template); |
|
241 | - throw new \InvalidArgumentException('A from email address must be provided (Variable $from) in Template: ' . $template); |
|
240 | + $log->err('A from email address must be provided (Variable $from) in Template: '.$template); |
|
241 | + throw new \InvalidArgumentException('A from email address must be provided (Variable $from) in Template: '.$template); |
|
242 | 242 | } |
243 | 243 | if (isset($this->config['fromName'])) { |
244 | 244 | $fromName = $this->config['fromName']; |
245 | 245 | } else { |
246 | - $log->err('A from name must be provided (Variable $fromName) in Template: ' . $template); |
|
247 | - throw new \InvalidArgumentException('A from name must be provided (Variable $fromName) in Template: ' . $template); |
|
246 | + $log->err('A from name must be provided (Variable $fromName) in Template: '.$template); |
|
247 | + throw new \InvalidArgumentException('A from name must be provided (Variable $fromName) in Template: '.$template); |
|
248 | 248 | } |
249 | 249 | if (isset($this->config['subject'])) { |
250 | 250 | $subject = $this->config['subject']; |
251 | 251 | } else { |
252 | - $log->err('A subject must be provided (Variable $subject) in Template: ' . $template); |
|
253 | - throw new \InvalidArgumentException('A subject must be provided (Variable $subject) in Template: ' . $template); |
|
252 | + $log->err('A subject must be provided (Variable $subject) in Template: '.$template); |
|
253 | + throw new \InvalidArgumentException('A subject must be provided (Variable $subject) in Template: '.$template); |
|
254 | 254 | } |
255 | 255 | $this->setFrom($from, $fromName); |
256 | 256 | $this->setSubject($subject); |
@@ -271,7 +271,7 @@ discard block |
||
271 | 271 | $erg = true; |
272 | 272 | $log->info($this); |
273 | 273 | } catch (\Exception $e) { |
274 | - $log->err('Mail failure ' . $e->getMessage()); |
|
274 | + $log->err('Mail failure '.$e->getMessage()); |
|
275 | 275 | } |
276 | 276 | return $erg; |
277 | 277 | } |
@@ -288,6 +288,6 @@ discard block |
||
288 | 288 | $viewResolver = $container->get('ViewResolver'); |
289 | 289 | $eventManager = $container->get('EventManager'); |
290 | 290 | $moduleManager = $container->get('ModuleManager'); |
291 | - return new static($mailLog,$viewResolver,$eventManager,$moduleManager); |
|
291 | + return new static($mailLog, $viewResolver, $eventManager, $moduleManager); |
|
292 | 292 | } |
293 | 293 | } |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | return $this; |
100 | 100 | } |
101 | 101 | |
102 | - public function getUsername(){ |
|
102 | + public function getUsername() { |
|
103 | 103 | return $this->connectionConfig['username']; |
104 | 104 | } |
105 | 105 | |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | return $this; |
111 | 111 | } |
112 | 112 | |
113 | - public function getPassword(){ |
|
113 | + public function getPassword() { |
|
114 | 114 | return $this->connectionConfig['password']; |
115 | 115 | } |
116 | 116 | |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | return $this; |
122 | 122 | } |
123 | 123 | |
124 | - public function getSsl(){ |
|
124 | + public function getSsl() { |
|
125 | 125 | return $this->connectionConfig['ssl']; |
126 | 126 | } |
127 | 127 | |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | return $this; |
131 | 131 | } |
132 | 132 | |
133 | - public function getTransportClass(){ |
|
133 | + public function getTransportClass() { |
|
134 | 134 | return $this->transportClass; |
135 | 135 | } |
136 | 136 | |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | */ |
140 | 140 | public function getPath() |
141 | 141 | { |
142 | - if(is_null($this->path) || false == $this->path){ |
|
142 | + if (is_null($this->path) || false == $this->path) { |
|
143 | 143 | $this->setPath(sys_get_temp_dir().'/yawik/mails'); |
144 | 144 | } |
145 | 145 | return $this->path; |
@@ -151,9 +151,9 @@ discard block |
||
151 | 151 | */ |
152 | 152 | public function setPath($path) |
153 | 153 | { |
154 | - if(!is_dir($path) && false !== $path){ |
|
155 | - mkdir($path,0777,true); |
|
156 | - chmod($path,0777); |
|
154 | + if (!is_dir($path) && false !== $path) { |
|
155 | + mkdir($path, 0777, true); |
|
156 | + chmod($path, 0777); |
|
157 | 157 | } |
158 | 158 | $this->path = $path; |
159 | 159 | return $this; |
@@ -13,15 +13,15 @@ discard block |
||
13 | 13 | $env = getenv('APPLICATION_ENV') ?: 'production'; |
14 | 14 | |
15 | 15 | $coreModules = include 'common.modules.php'; |
16 | -if (!file_exists(__DIR__ . '/autoload/yawik.config.global.php')) { |
|
17 | - $modules = array_merge($coreModules,[ |
|
16 | +if (!file_exists(__DIR__.'/autoload/yawik.config.global.php')) { |
|
17 | + $modules = array_merge($coreModules, [ |
|
18 | 18 | 'Install', |
19 | 19 | 'Core', |
20 | 20 | 'Auth', |
21 | 21 | 'Jobs', |
22 | 22 | ]); |
23 | 23 | } else { |
24 | - $modules = array_merge($coreModules,[ |
|
24 | + $modules = array_merge($coreModules, [ |
|
25 | 25 | 'Core', |
26 | 26 | 'Auth', |
27 | 27 | 'Cv', |
@@ -38,12 +38,12 @@ discard block |
||
38 | 38 | // kann und über Server-Variablen oder ähnlichen steuern kann |
39 | 39 | $allModules = False; |
40 | 40 | } |
41 | - foreach (glob(__DIR__ . '/autoload/*.module.php') as $moduleFile) { |
|
41 | + foreach (glob(__DIR__.'/autoload/*.module.php') as $moduleFile) { |
|
42 | 42 | $addModules = require $moduleFile; |
43 | 43 | foreach ($addModules as $addModule) { |
44 | 44 | if (strpos($addModule, '-') === 0) { |
45 | - $remove = substr($addModule,1); |
|
46 | - $modules = array_filter($modules, function ($elem) use ($remove) { return strcasecmp($elem,$remove); }); |
|
45 | + $remove = substr($addModule, 1); |
|
46 | + $modules = array_filter($modules, function($elem) use ($remove) { return strcasecmp($elem, $remove); }); |
|
47 | 47 | } |
48 | 48 | else { |
49 | 49 | if (!in_array($addModule, $modules)) { |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | ), |
97 | 97 | ); |
98 | 98 | |
99 | -$envConfigFile = __DIR__ . '/config.' . $env . '.php'; |
|
99 | +$envConfigFile = __DIR__.'/config.'.$env.'.php'; |
|
100 | 100 | if (file_exists($envConfigFile)) { |
101 | 101 | if (is_readable($envConfigFile)) { |
102 | 102 | $envConfig = include $envConfigFile; |