@@ -6,12 +6,10 @@ |
||
6 | 6 | namespace Zicht\Bundle\FrameworkExtraBundle\Command; |
7 | 7 | |
8 | 8 | use Exception; |
9 | - |
|
10 | 9 | use Monolog\Logger; |
11 | 10 | use Monolog\Handler\StreamHandler; |
12 | 11 | use Monolog\Processor\MemoryUsageProcessor; |
13 | 12 | use Monolog\Processor\MemoryPeakUsageProcessor; |
14 | - |
|
15 | 13 | use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand; |
16 | 14 | use Symfony\Component\Console\Output\OutputInterface; |
17 | 15 | use Symfony\Component\Console\Input\InputInterface; |
@@ -163,13 +163,13 @@ |
||
163 | 163 | $mutex = new Mutex($mutexFile, false); |
164 | 164 | $isLockAcquired = false; |
165 | 165 | $mutex->run( |
166 | - function () use ($self, $input, $output, &$result) { |
|
166 | + function() use ($self, $input, $output, &$result) { |
|
167 | 167 | return $self->doParentRun($input, $output); |
168 | 168 | }, |
169 | 169 | $isLockAcquired |
170 | 170 | ); |
171 | 171 | if (!$isLockAcquired && $this->logger) { |
172 | - $this->logger->addWarning("Mutex failed in " . get_class($this) . ", job was not run"); |
|
172 | + $this->logger->addWarning("Mutex failed in ".get_class($this).", job was not run"); |
|
173 | 173 | } |
174 | 174 | } else { |
175 | 175 | $result = $this->doParentRun($input, $output); |
@@ -54,7 +54,7 @@ |
||
54 | 54 | * Get annotation |
55 | 55 | * |
56 | 56 | * @param string $name |
57 | - * @return array |
|
57 | + * @return string |
|
58 | 58 | */ |
59 | 59 | public function getAnnotation($name) |
60 | 60 | { |
@@ -46,7 +46,7 @@ |
||
46 | 46 | $this->setAnnotation($annotation['key'], $new_annotation); |
47 | 47 | } |
48 | 48 | } else { |
49 | - $this->annotations[]= $new_annotation; |
|
49 | + $this->annotations[] = $new_annotation; |
|
50 | 50 | } |
51 | 51 | } |
52 | 52 |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | * Get the top most (root) element of the form view |
54 | 54 | * |
55 | 55 | * @param FormView $formView |
56 | - * @return mixed |
|
56 | + * @return FormView |
|
57 | 57 | */ |
58 | 58 | public static function getFormRoot($formView) |
59 | 59 | { |
@@ -296,7 +296,7 @@ discard block |
||
296 | 296 | * Returns the ID the form's state is stored by in the session |
297 | 297 | * |
298 | 298 | * @param \Symfony\Component\Form\FormInterface $form |
299 | - * @return mixed |
|
299 | + * @return string |
|
300 | 300 | */ |
301 | 301 | public function getFormId(FormInterface $form) |
302 | 302 | { |
@@ -280,7 +280,7 @@ |
||
280 | 280 | $viewVars['messages'] = []; |
281 | 281 | if ($request->hasPreviousSession() && ($messages = $this->container->get('session')->getFlashBag()->get($formId))) { |
282 | 282 | foreach ($messages as $value) { |
283 | - $viewVars['messages'][] = $prefix . $value; |
|
283 | + $viewVars['messages'][] = $prefix.$value; |
|
284 | 284 | } |
285 | 285 | } |
286 | 286 |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | /** |
124 | 124 | * Returns the 1-indexed start of the displayed range, used for displaying in templates |
125 | 125 | * |
126 | - * @return int |
|
126 | + * @return double |
|
127 | 127 | */ |
128 | 128 | public function getRangeStart() |
129 | 129 | { |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | /** |
135 | 135 | * Returns the 1-indexed end of the displayed range, used for displaying in templates |
136 | 136 | * |
137 | - * @return int |
|
137 | + * @return double |
|
138 | 138 | */ |
139 | 139 | public function getRangeEnd() |
140 | 140 | { |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | /** |
146 | 146 | * Combines the getRangeStart() and getRangeEnd() in one array |
147 | 147 | * |
148 | - * @return array |
|
148 | + * @return double[] |
|
149 | 149 | */ |
150 | 150 | public function getRange() |
151 | 151 | { |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | } |
83 | 83 | if ((int)$page != $page) { |
84 | 84 | throw new \InvalidArgumentException( |
85 | - "Invalid argument \$page, expected integer number, got " . gettype($page) |
|
85 | + "Invalid argument \$page, expected integer number, got ".gettype($page) |
|
86 | 86 | ); |
87 | 87 | } |
88 | 88 | $this->numPages = (int)ceil($this->total / $this->itemsPerPage); |
@@ -343,7 +343,7 @@ discard block |
||
343 | 343 | */ |
344 | 344 | public function offsetSet($offset, $value) |
345 | 345 | { |
346 | - throw new \BadMethodCallException(__CLASS__ . ' is read only'); |
|
346 | + throw new \BadMethodCallException(__CLASS__.' is read only'); |
|
347 | 347 | } |
348 | 348 | |
349 | 349 | |
@@ -357,7 +357,7 @@ discard block |
||
357 | 357 | */ |
358 | 358 | public function offsetUnset($offset) |
359 | 359 | { |
360 | - throw new \BadMethodCallException(__CLASS__ . ' is read only'); |
|
360 | + throw new \BadMethodCallException(__CLASS__.' is read only'); |
|
361 | 361 | } |
362 | 362 | |
363 | 363 | |
@@ -398,7 +398,7 @@ discard block |
||
398 | 398 | $isPreviousGap = false; |
399 | 399 | } elseif (!$isPreviousGap) { |
400 | 400 | $isPreviousGap = true; |
401 | - $ret[$i]= null; |
|
401 | + $ret[$i] = null; |
|
402 | 402 | } |
403 | 403 | } |
404 | 404 |
@@ -95,7 +95,7 @@ |
||
95 | 95 | * Checks if the token is part of the current control structure. |
96 | 96 | * |
97 | 97 | * @param Twig_Token $token |
98 | - * @return mixed |
|
98 | + * @return boolean |
|
99 | 99 | */ |
100 | 100 | public function decideSwitchFork($token) |
101 | 101 | { |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | } |
105 | 105 | |
106 | 106 | /** |
107 | - * @return array |
|
107 | + * @return Twig_SimpleFilter[] |
|
108 | 108 | */ |
109 | 109 | public function getFilters() |
110 | 110 | { |
@@ -303,7 +303,7 @@ discard block |
||
303 | 303 | * |
304 | 304 | * @param array|Collection $items |
305 | 305 | * @param array $keyValuePairs |
306 | - * @return array |
|
306 | + * @return Collection[] |
|
307 | 307 | */ |
308 | 308 | public function whereSplit($items, $keyValuePairs) |
309 | 309 | { |
@@ -325,7 +325,7 @@ discard block |
||
325 | 325 | * </form> |
326 | 326 | * |
327 | 327 | * @param string $url |
328 | - * @return array |
|
328 | + * @return string |
|
329 | 329 | */ |
330 | 330 | public function urlStripQuery($url) |
331 | 331 | { |
@@ -772,7 +772,7 @@ discard block |
||
772 | 772 | * |
773 | 773 | * @param mixed $var |
774 | 774 | * @param string $mode |
775 | - * @return mixed |
|
775 | + * @return string|null |
|
776 | 776 | */ |
777 | 777 | public function dump($var, $mode = null) |
778 | 778 | { |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | public function prefixMultiple($values, $prefix) |
159 | 159 | { |
160 | 160 | return iter\map( |
161 | - function ($value) use ($prefix) { |
|
161 | + function($value) use ($prefix) { |
|
162 | 162 | return sprintf('%s%s', $prefix, $value); |
163 | 163 | }, |
164 | 164 | $values |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | { |
179 | 179 | $translator = $this->translator; |
180 | 180 | return iter\map( |
181 | - function ($message) use ($translator, $parameters, $domain, $locale) { |
|
181 | + function($message) use ($translator, $parameters, $domain, $locale) { |
|
182 | 182 | return $this->translator->trans($message, $parameters, $domain, $locale); |
183 | 183 | }, |
184 | 184 | $messages |
@@ -266,7 +266,7 @@ discard block |
||
266 | 266 | $items->initialize(); |
267 | 267 | } |
268 | 268 | |
269 | - $whereMethod = $booleanOperator . 'Where'; |
|
269 | + $whereMethod = $booleanOperator.'Where'; |
|
270 | 270 | |
271 | 271 | $eb = new ExpressionBuilder(); |
272 | 272 | $criteria = new Criteria(); |
@@ -330,7 +330,7 @@ discard block |
||
330 | 330 | public function urlStripQuery($url) |
331 | 331 | { |
332 | 332 | $query = parse_url($url, PHP_URL_QUERY); |
333 | - return str_replace('?' . $query, '', $url); |
|
333 | + return str_replace('?'.$query, '', $url); |
|
334 | 334 | } |
335 | 335 | |
336 | 336 | /** |
@@ -483,7 +483,7 @@ discard block |
||
483 | 483 | |
484 | 484 | usort( |
485 | 485 | $collection, |
486 | - function ($left, $right) use ($types, $idToIndexMap, $numTypes) { |
|
486 | + function($left, $right) use ($types, $idToIndexMap, $numTypes) { |
|
487 | 487 | $localClassNameLeft = Str::classname(get_class($left)); |
488 | 488 | $localClassNameRight = Str::classname(get_class($right)); |
489 | 489 | |
@@ -617,7 +617,7 @@ discard block |
||
617 | 617 | |
618 | 618 | if (null !== $this->translator) { |
619 | 619 | $message = $this->translator->trans( |
620 | - '%count% ' . $denominator . ' ago', |
|
620 | + '%count% '.$denominator.' ago', |
|
621 | 621 | array('%count%' => $diff->$part) |
622 | 622 | ); |
623 | 623 | } else { |
@@ -655,8 +655,8 @@ discard block |
||
655 | 655 | { |
656 | 656 | $result = ''; |
657 | 657 | foreach (preg_split('/\b/U', $str) as $part) { |
658 | - if (strlen($result . $part) > $length) { |
|
659 | - $result = rtrim($result) . $ellipsis; |
|
658 | + if (strlen($result.$part) > $length) { |
|
659 | + $result = rtrim($result).$ellipsis; |
|
660 | 660 | break; |
661 | 661 | } else { |
662 | 662 | $result .= $part; |
@@ -731,7 +731,7 @@ discard block |
||
731 | 731 | parse_str($query, $currentParams); |
732 | 732 | $currentParams += $embedParams; |
733 | 733 | |
734 | - return preg_replace('/\?$/', '', $urlOrArray) . '?' . http_build_query($currentParams); |
|
734 | + return preg_replace('/\?$/', '', $urlOrArray).'?'.http_build_query($currentParams); |
|
735 | 735 | } else { |
736 | 736 | throw new \InvalidArgumentException("Only supports arrays or strings"); |
737 | 737 | } |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | */ |
25 | 25 | public function insert($item, $priority) |
26 | 26 | { |
27 | - $this->items[]= array($priority, $item); |
|
27 | + $this->items[] = array($priority, $item); |
|
28 | 28 | |
29 | 29 | $this->sort(); |
30 | 30 | } |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | { |
40 | 40 | usort( |
41 | 41 | $this->items, |
42 | - function ($a, $b) { |
|
42 | + function($a, $b) { |
|
43 | 43 | return $a[0] > $b[0] ? 1 : $a[0] === $b[0] ? 0 : -1; |
44 | 44 | } |
45 | 45 | ); |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | { |
53 | 53 | return new \ArrayIterator( |
54 | 54 | array_map( |
55 | - function ($item) { |
|
55 | + function($item) { |
|
56 | 56 | return $item[1]; |
57 | 57 | }, |
58 | 58 | $this->items |
@@ -96,7 +96,7 @@ |
||
96 | 96 | $allMessages = $this->getTranslationsForLocale($locale); |
97 | 97 | |
98 | 98 | if (!array_key_exists($domain, $allMessages)) { |
99 | - throw new \Exception('Domain ' . $domain . ' not found in the translations for locale ' . $locale); |
|
99 | + throw new \Exception('Domain '.$domain.' not found in the translations for locale '.$locale); |
|
100 | 100 | } |
101 | 101 | |
102 | 102 | return $allMessages[$domain]; |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | ->addOption( |
37 | 37 | 'group', |
38 | 38 | 'g', |
39 | - InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, |
|
39 | + InputOption::VALUE_REQUIRED|InputOption::VALUE_IS_ARRAY, |
|
40 | 40 | "Optional validation group(s)" |
41 | 41 | ); |
42 | 42 | } |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | $violations = $this->getContainer()->get('validator')->validate($entity, $groups ? $groups : null); |
57 | 57 | |
58 | 58 | if (count($violations)) { |
59 | - $output->writeln(get_class($entity) . "::" . $entity->getId()); |
|
59 | + $output->writeln(get_class($entity)."::".$entity->getId()); |
|
60 | 60 | foreach ($violations as $error) { |
61 | 61 | $output->writeln(" -> {$error}"); |
62 | 62 | } |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | ->getMetadataFactory() |
80 | 80 | ->getAllMetadata(); |
81 | 81 | |
82 | - $isAcceptable = function ($meta) { |
|
82 | + $isAcceptable = function($meta) { |
|
83 | 83 | return !$meta->isMappedSuperclass && empty($meta->subClasses); |
84 | 84 | }; |
85 | 85 |