@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | * @param array $defaultParams |
47 | 47 | * @param bool $usePostParams |
48 | 48 | * |
49 | - * @return mixed |
|
49 | + * @return ZendPaginator |
|
50 | 50 | */ |
51 | 51 | public function __invoke($paginatorName, $defaultParams = array(), $usePostParams = false) |
52 | 52 | { |
@@ -106,7 +106,6 @@ discard block |
||
106 | 106 | } |
107 | 107 | |
108 | 108 | /** |
109 | - * @param ControllerManager $controllerManager |
|
110 | 109 | * @return CreatePaginatorService |
111 | 110 | */ |
112 | 111 | public static function factory(ContainerInterface $container) |
@@ -81,7 +81,7 @@ |
||
81 | 81 | |
82 | 82 | $adapter->setParams($params); |
83 | 83 | $paginator->setCurrentPageNumber($params->get('page', 1)) |
84 | - ->setItemCountPerPage($params->get('count', 10)); |
|
84 | + ->setItemCountPerPage($params->get('count', 10)); |
|
85 | 85 | |
86 | 86 | return $paginator; |
87 | 87 | } |
@@ -61,11 +61,11 @@ |
||
61 | 61 | $paginatorManager = $this->serviceManager->get('Core/PaginatorService'); |
62 | 62 | $paginator = $paginatorManager->get($paginatorName); |
63 | 63 | if (!isset($paginator) || !$paginator instanceof ZendPaginator) { |
64 | - throw new \RuntimeException('Could not create paginator ' . $paginatorName); |
|
64 | + throw new \RuntimeException('Could not create paginator '.$paginatorName); |
|
65 | 65 | } |
66 | 66 | $adapter = $paginator->getAdapter(); |
67 | 67 | if (!isset($adapter) || !$adapter instanceof AdapterInterface) { |
68 | - throw new \RuntimeException('Paginator ' . $paginatorName . ' has no Adapter'); |
|
68 | + throw new \RuntimeException('Paginator '.$paginatorName.' has no Adapter'); |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | $params = $usePostParams |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | protected $generator; |
51 | 51 | |
52 | 52 | /** |
53 | - * @param $serviceLocator |
|
53 | + * @param \Interop\Container\ContainerInterface $serviceLocator |
|
54 | 54 | * @return $this |
55 | 55 | */ |
56 | 56 | public function setServiceLocator($serviceLocator) |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | } |
79 | 79 | |
80 | 80 | /** |
81 | - * @return mixed |
|
81 | + * @return RepositoryInterface |
|
82 | 82 | */ |
83 | 83 | public function getRepositories() |
84 | 84 | { |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | $target->__invoke($data); |
150 | 150 | $className = get_class($this->entity); |
151 | 151 | // @TODO, have to be abstract |
152 | - $snapShotMetaClassName = '\\' . $className . 'SnapshotMeta'; |
|
152 | + $snapShotMetaClassName = '\\'.$className.'SnapshotMeta'; |
|
153 | 153 | $meta = new $snapShotMetaClassName; |
154 | 154 | $meta->setEntity($target); |
155 | 155 | $meta->setSourceId($this->entity->id); |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | if (empty($dataHead) || empty($targetClass)) { |
178 | 178 | return null; |
179 | 179 | } |
180 | - $repositorySnapshotMeta = $this->getRepositories()->getRepository($targetClass . "Meta"); |
|
180 | + $repositorySnapshotMeta = $this->getRepositories()->getRepository($targetClass."Meta"); |
|
181 | 181 | $snapshot = $repositorySnapshotMeta->findSnapshot($this->entity); |
182 | 182 | // an snapshot has to be so simple that there is no need for a special hydrator |
183 | 183 | $hydrator = new EntityHydrator(); |
@@ -247,8 +247,8 @@ discard block |
||
247 | 247 | // the snapshotgenerator is a service defined by the name of the entity |
248 | 248 | // this is the highest means, all subsequent means just add what is not set |
249 | 249 | $className = get_class($this->entity); |
250 | - if ($serviceLocator->has('snapshotgenerator' . $className)) { |
|
251 | - $generator = $this->serviceLocator->get('snapshotgenerator' . $className); |
|
250 | + if ($serviceLocator->has('snapshotgenerator'.$className)) { |
|
251 | + $generator = $this->serviceLocator->get('snapshotgenerator'.$className); |
|
252 | 252 | if (is_array($generator)) { |
253 | 253 | $this->options = ArrayUtils::merge($generator, $this->options); |
254 | 254 | $generator = null; |
@@ -348,13 +348,13 @@ discard block |
||
348 | 348 | } |
349 | 349 | } else { |
350 | 350 | if ($array1[$key] != $array2[$key]) { |
351 | - $result[$key] = array( $array1[$key], $array2[$key]); |
|
351 | + $result[$key] = array($array1[$key], $array2[$key]); |
|
352 | 352 | } |
353 | 353 | } |
354 | 354 | if (!empty($subResult)) { |
355 | 355 | foreach ($subResult as $subKey => $subValue) { |
356 | 356 | if (!empty($subKey) && is_string($subKey)) { |
357 | - $result[$key . '.' . $subKey] = $subValue; |
|
357 | + $result[$key.'.'.$subKey] = $subValue; |
|
358 | 358 | } |
359 | 359 | } |
360 | 360 | } |
@@ -72,6 +72,9 @@ discard block |
||
72 | 72 | return $this; |
73 | 73 | } |
74 | 74 | |
75 | + /** |
|
76 | + * @param AddressList $header |
|
77 | + */ |
|
75 | 78 | protected function stringFromMailHeader($header) |
76 | 79 | { |
77 | 80 | $erg = ''; |
@@ -160,6 +163,9 @@ discard block |
||
160 | 163 | } |
161 | 164 | } |
162 | 165 | |
166 | + /** |
|
167 | + * @return string |
|
168 | + */ |
|
163 | 169 | protected function getTemplate() |
164 | 170 | { |
165 | 171 | $template = null; |
@@ -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 | } |
@@ -110,7 +110,6 @@ |
||
110 | 110 | * @see \Core\Controller\Plugin\SearchForm::get() |
111 | 111 | * |
112 | 112 | * @param $elementsFieldset |
113 | - * @param null $buttonsFieldset |
|
114 | 113 | * @param string $as The name of the key in the result array. |
115 | 114 | * |
116 | 115 | * @return self |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | } |
79 | 79 | |
80 | 80 | if (!is_array($stack)) { |
81 | - throw new \InvalidArgumentException('Expected argument to be of type array, but received ' . gettype($stack)); |
|
81 | + throw new \InvalidArgumentException('Expected argument to be of type array, but received '.gettype($stack)); |
|
82 | 82 | } |
83 | 83 | |
84 | 84 | $stack = array_intersect_key($stack, ['params' => true, 'form' => true, 'paginator' => true]); |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | * |
148 | 148 | * @return self |
149 | 149 | */ |
150 | - public function params($namespace, $defaults = [ 'page' => 1 ]) |
|
150 | + public function params($namespace, $defaults = ['page' => 1]) |
|
151 | 151 | { |
152 | 152 | $this->stack['params'] = [$namespace, $defaults]; |
153 | 153 | return $this; |
@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | $queryArray[$match['name']][$v] = 1; |
243 | 243 | } |
244 | 244 | } else { |
245 | - $queryArray[ $match[ 'name' ] ] = $value; |
|
245 | + $queryArray[$match['name']] = $value; |
|
246 | 246 | } |
247 | 247 | unset($queryArray[$key]); |
248 | 248 | } |
@@ -46,10 +46,8 @@ |
||
46 | 46 | * |
47 | 47 | * Proxies to {@link get()} |
48 | 48 | * |
49 | - * @param string|array $elementsFieldset |
|
50 | - * @param null|string $buttonsFieldset |
|
51 | 49 | * |
52 | - * @return \Core\Form\TextSearchForm |
|
50 | + * @return \Core\Form\SearchForm |
|
53 | 51 | */ |
54 | 52 | public function __invoke($form, $options = null, $params = null) |
55 | 53 | { |
@@ -72,11 +72,11 @@ |
||
72 | 72 | public function get($form, $options = null, $params = null) |
73 | 73 | { |
74 | 74 | if (!is_object($form)) { |
75 | - $form = $this->formElementManager->get($form, $options); |
|
75 | + $form = $this->formElementManager->get($form, $options); |
|
76 | 76 | } |
77 | 77 | |
78 | 78 | /** @noinspection PhpUndefinedMethodInspection */ |
79 | - $params = $params ?: clone $this->getController()->getRequest()->getQuery(); |
|
79 | + $params = $params ?: clone $this->getController()->getRequest()->getQuery(); |
|
80 | 80 | |
81 | 81 | /* I tried using form methods (bind, isValid)... |
82 | 82 | * but because the search form could be in an invalidated state |
@@ -55,7 +55,6 @@ |
||
55 | 55 | * Two-letter codes from the ISO 3166 standard as implemented by The Internet Assigned |
56 | 56 | * Numbers Authority. |
57 | 57 | * |
58 | - * @param string $postalCode {'AC'|'AD'|'AE'|'AF'|'AG'|'AI'|'AL'|'AM'|'AN'|'AO'|'AQ'|'AR'|'AS'|'AT'|'AU'|'AW'|'AX'|'AZ'|'BA'|'BB'|'BD'|'BE'|'BF'|'BG'|'BH'|'BI'|'BJ'|'BL'|'BM'|'BN'|'BO'|'BR'|'BS'|'BT'|'BV'|'BW'|'BY'|'BZ'|'CA'|'CC'|'CD'|'CF'|'CG'|'CH'|'CI'|'CK'|'CL'|'CM'|'CN'|'CO'|'CR'|'CU'|'CV'|'CX'|'CY'|'CZ'|'DE'|'DJ'|'DK'|'DM'|'DO'|'DZ'|'EC'|'EE'|'EG'|'EH'|'ER'|'ES'|'ET'|'EU'|'FI'|'FJ'|'FK'|'FM'|'FO'|'FR'|'GA'|'GB'|'GD'|'GE'|'GF'|'GG'|'GH'|'GI'|'GL'|'GM'|'GN'|'GP'|'GQ'|'GR'|'GS'|'GT'|'GU'|'GW'|'GY'|'HK'|'HM'|'HN'|'HR'|'HT'|'HU'|'ID'|'IE'|'IL'|'IM'|'IN'|'IO'|'IQ'|'IR'|'IS'|'IT'|'JE'|'JM'|'JO'|'JP'|'KE'|'KG'|'KH'|'KI'|'KM'|'KN'|'KP'|'KR'|'KW'|'KY'|'KZ'|'LA'|'LB'|'LC'|'LI'|'LK'|'LR'|'LS'|'LT'|'LU'|'LV'|'LY'|'MA'|'MC'|'MD'|'ME'|'MF'|'MG'|'MH'|'MK'|'ML'|'MM'|'MN'|'MO'|'MP'|'MQ'|'MR'|'MS'|'MT'|'MU'|'MV'|'MW'|'MX'|'MY'|'MZ'|'NA'|'NC'|'NE'|'NF'|'NG'|'NI'|'NL'|'NO'|'NP'|'NR'|'NU'|'NZ'|'OM'|'PA'|'PE'|'PF'|'PG'|'PH'|'PK'|'PL'|'PM'|'PN'|'PR'|'PS'|'PT'|'PW'|'PY'|'QA'|'RE'|'RO'|'RS'|'RU'|'RW'|'SA'|'SB'|'SC'|'SD'|'SE'|'SG'|'SH'|'SI'|'SJ'|'SK'|'SL'|'SM'|'SN'|'SO'|'SR'|'ST'|'SU'|'SV'|'SY'|'SZ'|'TC'|'TD'|'TF'|'TG'|'TH'|'TJ'|'TK'|'TL'|'TM'|'TN'|'TO'|'TP'|'TR'|'TT'|'TV'|'TW'|'TZ'|'UA'|'UG'|'UK'|'UM'|'US'|'UY'|'UZ'|'VA'|'VC'|'VE'|'VG'|'VI'|'VN'|'VU'|'WF'|'WS'|'YE'|'YT'|'YU'|'ZA'|'ZM'|'ZW'} |
|
59 | 58 | * @return AddressInterface |
60 | 59 | */ |
61 | 60 | public function setCountryCode($countryCode); |
@@ -14,12 +14,12 @@ |
||
14 | 14 | interface AddressInterface extends EntityInterface |
15 | 15 | { |
16 | 16 | |
17 | - /** |
|
18 | - * Postal Code of the Address. |
|
19 | - * |
|
20 | - * @param string $postalCode |
|
21 | - * @return AddressInterface |
|
22 | - */ |
|
17 | + /** |
|
18 | + * Postal Code of the Address. |
|
19 | + * |
|
20 | + * @param string $postalCode |
|
21 | + * @return AddressInterface |
|
22 | + */ |
|
23 | 23 | public function setPostalCode($postalCode); |
24 | 24 | public function getPostalCode(); |
25 | 25 |
@@ -22,6 +22,7 @@ |
||
22 | 22 | /** |
23 | 23 | * @param AttachableEntityManager $attachableEntityManager |
24 | 24 | * @throws \LogicException If attachable entity manager is already set |
25 | + * @return AttachableEntityTrait |
|
25 | 26 | */ |
26 | 27 | public function setAttachableEntityManager(AttachableEntityManager $attachableEntityManager); |
27 | 28 |
@@ -22,6 +22,9 @@ |
||
22 | 22 | */ |
23 | 23 | trait EntityTrait |
24 | 24 | { |
25 | + /** |
|
26 | + * @param string $property |
|
27 | + */ |
|
25 | 28 | public function notEmpty($property, array $args=[]) |
26 | 29 | { |
27 | 30 | $method = "get$property"; |
@@ -20,16 +20,16 @@ |
||
20 | 20 | */ |
21 | 21 | trait EntityTrait |
22 | 22 | { |
23 | - public function notEmpty($property, array $args=[]) |
|
23 | + public function notEmpty($property, array $args = []) |
|
24 | 24 | { |
25 | 25 | $method = "get$property"; |
26 | 26 | |
27 | 27 | if (!method_exists($this, $method)) { |
28 | - throw new OutOfBoundsException("'$property' is not a valid property of '" . get_class($this) . "'"); |
|
28 | + throw new OutOfBoundsException("'$property' is not a valid property of '".get_class($this)."'"); |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | $value = count($args) |
32 | - ? call_user_func_array([ $this, $method ], $args) |
|
32 | + ? call_user_func_array([$this, $method], $args) |
|
33 | 33 | : $this->$method(); |
34 | 34 | |
35 | 35 | if (null === $value) { // is_scalar does not consider 'null' to be scalar value. |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | /** |
130 | 130 | * Gets the name of a file |
131 | 131 | * |
132 | - * @return mixed |
|
132 | + * @return string |
|
133 | 133 | */ |
134 | 134 | public function getName() |
135 | 135 | { |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | /** |
198 | 198 | * Gets the uploaded date of a file |
199 | 199 | * |
200 | - * @return mixed |
|
200 | + * @return null|\DateTime |
|
201 | 201 | */ |
202 | 202 | public function getDateUploaded() |
203 | 203 | { |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | /** |
234 | 234 | * Gets the length of the file |
235 | 235 | * |
236 | - * @return mixed |
|
236 | + * @return string|null |
|
237 | 237 | */ |
238 | 238 | public function getLength() |
239 | 239 | { |
@@ -146,18 +146,18 @@ |
||
146 | 146 | $size = $this->getLength(); |
147 | 147 | |
148 | 148 | if ($size >= 1073741824) { |
149 | - return round($size / 1073741824, 2) . ' GB'; |
|
149 | + return round($size / 1073741824, 2).' GB'; |
|
150 | 150 | } |
151 | 151 | |
152 | 152 | if ($size >= 1048576) { |
153 | - return round($size / 1048576, 2) . ' MB'; |
|
153 | + return round($size / 1048576, 2).' MB'; |
|
154 | 154 | } |
155 | 155 | |
156 | 156 | if ($size >= 1024) { |
157 | - return round($size / 1024, 2) . ' kB'; |
|
157 | + return round($size / 1024, 2).' kB'; |
|
158 | 158 | } |
159 | 159 | |
160 | - return (string)$size; |
|
160 | + return (string) $size; |
|
161 | 161 | } |
162 | 162 | |
163 | 163 | /** |