@@ -25,13 +25,13 @@ |
||
25 | 25 | */ |
26 | 26 | class PaginatorServiceFactory implements FactoryInterface |
27 | 27 | { |
28 | - public function __invoke( ContainerInterface $container, $requestedName, array $options = null ) |
|
29 | - { |
|
30 | - $configArray = $container->get('Config'); |
|
31 | - $configArray = isset($configArray['paginator_manager']) ? $configArray['paginator_manager'] : array(); |
|
32 | - $config = new PaginatorServiceConfig($configArray); |
|
33 | - $service = new PaginatorService($container,$config->toArray()); |
|
28 | + public function __invoke( ContainerInterface $container, $requestedName, array $options = null ) |
|
29 | + { |
|
30 | + $configArray = $container->get('Config'); |
|
31 | + $configArray = isset($configArray['paginator_manager']) ? $configArray['paginator_manager'] : array(); |
|
32 | + $config = new PaginatorServiceConfig($configArray); |
|
33 | + $service = new PaginatorService($container,$config->toArray()); |
|
34 | 34 | |
35 | - return $service; |
|
36 | - } |
|
35 | + return $service; |
|
36 | + } |
|
37 | 37 | } |
@@ -25,12 +25,12 @@ |
||
25 | 25 | */ |
26 | 26 | class PaginatorServiceFactory implements FactoryInterface |
27 | 27 | { |
28 | - public function __invoke( ContainerInterface $container, $requestedName, array $options = null ) |
|
28 | + public function __invoke(ContainerInterface $container, $requestedName, array $options = null) |
|
29 | 29 | { |
30 | 30 | $configArray = $container->get('Config'); |
31 | 31 | $configArray = isset($configArray['paginator_manager']) ? $configArray['paginator_manager'] : array(); |
32 | 32 | $config = new PaginatorServiceConfig($configArray); |
33 | - $service = new PaginatorService($container,$config->toArray()); |
|
33 | + $service = new PaginatorService($container, $config->toArray()); |
|
34 | 34 | |
35 | 35 | return $service; |
36 | 36 | } |
@@ -89,7 +89,7 @@ |
||
89 | 89 | } |
90 | 90 | |
91 | 91 | if (!$target) { |
92 | - $target = get_class($source) . 'Snapshot'; |
|
92 | + $target = get_class($source).'Snapshot'; |
|
93 | 93 | $target = new $target($source); |
94 | 94 | } |
95 | 95 |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | } |
72 | 72 | $config['log'] = $log; |
73 | 73 | |
74 | - return new static($eventManager,$config); |
|
74 | + return new static($eventManager, $config); |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | public function startDebug() |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | /** @var Logger $logger */ |
102 | 102 | $logger = Debugger::getLogger(); |
103 | 103 | $logger->emailSnooze = $config['email_snooze']; |
104 | - $logger->mailer = function ($message, $email) use ($logger) { |
|
104 | + $logger->mailer = function($message, $email) use ($logger) { |
|
105 | 105 | $exceptionFile = null; |
106 | 106 | |
107 | 107 | if ($message instanceof \Exception || $message instanceof \Throwable) { |
@@ -110,9 +110,9 @@ discard block |
||
110 | 110 | while ($message) { |
111 | 111 | $tmp[] = ( |
112 | 112 | $message instanceof \ErrorException |
113 | - ? Helpers::errorTypeToString($message->getSeverity()) . ': ' . $message->getMessage() |
|
114 | - : Helpers::getClass($message) . ': ' . $message->getMessage() . ($message->getCode() ? ' #' . $message->getCode() : '') |
|
115 | - ) . ' in ' . $message->getFile() . ':' . $message->getLine(); |
|
113 | + ? Helpers::errorTypeToString($message->getSeverity()).': '.$message->getMessage() |
|
114 | + : Helpers::getClass($message).': '.$message->getMessage().($message->getCode() ? ' #'.$message->getCode() : '') |
|
115 | + ).' in '.$message->getFile().':'.$message->getLine(); |
|
116 | 116 | $message = $message->getPrevious(); |
117 | 117 | } |
118 | 118 | $message = implode("\ncaused by ", $tmp); |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | $host = preg_replace('#[^\w.-]+#', '', isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : php_uname('n')); |
129 | 129 | $mimeMessage = new Mime\Message(); |
130 | 130 | |
131 | - $text = new Mime\Part($message . "\n\nsource: " . Helpers::getSource()); |
|
131 | + $text = new Mime\Part($message."\n\nsource: ".Helpers::getSource()); |
|
132 | 132 | $text->type = Mime\Mime::TYPE_TEXT; |
133 | 133 | $text->charset = 'utf-8'; |
134 | 134 | $mimeMessage->addPart($text); |
@@ -92,8 +92,8 @@ |
||
92 | 92 | */ |
93 | 93 | protected function authetificate() |
94 | 94 | { |
95 | - $auth = array_key_exists('user', $this->config)?$this->config['user']:''; |
|
96 | - $pass = array_key_exists('pass', $this->config)?$this->config['pass']:''; |
|
95 | + $auth = array_key_exists('user', $this->config) ? $this->config['user'] : ''; |
|
96 | + $pass = array_key_exists('pass', $this->config) ? $this->config['pass'] : ''; |
|
97 | 97 | return $this->setAuth($auth, $pass); |
98 | 98 | } |
99 | 99 |
@@ -89,11 +89,11 @@ discard block |
||
89 | 89 | $config = $this->serviceManager->get('Config'); |
90 | 90 | $appConfig = $this->serviceManager->get('ApplicationConfig'); |
91 | 91 | foreach ($appConfig['modules'] as $module) { |
92 | - $this->config[$module] = array_key_exists($module, $config)?$config[$module]:array(); |
|
92 | + $this->config[$module] = array_key_exists($module, $config) ? $config[$module] : array(); |
|
93 | 93 | } |
94 | 94 | } |
95 | 95 | if (isset($namespace)) { |
96 | - return array_key_exists($namespace, $this->config)?$this->config[$namespace]: array(); |
|
96 | + return array_key_exists($namespace, $this->config) ? $this->config[$namespace] : array(); |
|
97 | 97 | } |
98 | 98 | return $this->config; |
99 | 99 | } |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | } |
107 | 107 | if (!empty($this->map[$key])) { |
108 | 108 | $module = $this->getNamespace(); |
109 | - return isset($this->map[$key][$module])?$this->map[$key][$module]:array(); |
|
109 | + return isset($this->map[$key][$module]) ? $this->map[$key][$module] : array(); |
|
110 | 110 | } |
111 | 111 | return array(); |
112 | 112 | } |
@@ -159,7 +159,7 @@ |
||
159 | 159 | : [ |
160 | 160 | 'description' => isset($result[2]) ? $result[2] : null, |
161 | 161 | 'viewScript' => isset($result[3]) ? $result[3] : null, |
162 | - ], |
|
162 | + ], |
|
163 | 163 | ]; |
164 | 164 | } |
165 | 165 |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | public function setEventPrototype(EventInterface $prototype) |
36 | 36 | { |
37 | 37 | if (!$prototype instanceof DependencyResultEvent) { |
38 | - throw new \InvalidArgumentException('This event manager only accepts events of the type ' . DependencyResultEvent::class); |
|
38 | + throw new \InvalidArgumentException('This event manager only accepts events of the type '.DependencyResultEvent::class); |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | parent::setEventPrototype($prototype); |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | protected function triggerListeners(EventInterface $event, callable $callback = null) |
56 | 56 | { |
57 | 57 | if (!$event instanceof DependencyResultEvent) { |
58 | - throw new \InvalidArgumentException('This event manager only accepts events of the type ' . DependencyResultEvent::class); |
|
58 | + throw new \InvalidArgumentException('This event manager only accepts events of the type '.DependencyResultEvent::class); |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | $results = parent::triggerListeners($event, $callback); |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | { |
51 | 51 | use ZfListenerAggregateTrait; |
52 | 52 | |
53 | - public function attach(EventManagerInterface $events, $priority=1) |
|
53 | + public function attach(EventManagerInterface $events, $priority = 1) |
|
54 | 54 | { |
55 | 55 | return $this->attachEvents($events); |
56 | 56 | } |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | $method = $spec[1]; |
90 | 90 | $priority = isset($spec[2]) ? $spec[2] : 0; |
91 | 91 | |
92 | - $this->listeners[] = $events->attach($event, [ $this, $method ], $priority); |
|
92 | + $this->listeners[] = $events->attach($event, [$this, $method], $priority); |
|
93 | 93 | } |
94 | 94 | |
95 | 95 | return $this; |
@@ -40,10 +40,10 @@ |
||
40 | 40 | |
41 | 41 | |
42 | 42 | /** |
43 | - * Loads module specific configuration. |
|
44 | - * |
|
45 | - * @return array |
|
46 | - */ |
|
43 | + * Loads module specific configuration. |
|
44 | + * |
|
45 | + * @return array |
|
46 | + */ |
|
47 | 47 | public function getConfig() |
48 | 48 | { |
49 | 49 | return ModuleConfigLoader::load(__DIR__ . '/../config'); |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | */ |
53 | 53 | public function getConfig() |
54 | 54 | { |
55 | - return ModuleConfigLoader::load(__DIR__ . '/../config'); |
|
55 | + return ModuleConfigLoader::load(__DIR__.'/../config'); |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | public static function factory(ServiceManager $serviceManager) |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | $eventManager->getSharedManager()->attach( |
69 | 69 | 'Applications', |
70 | 70 | 'application.detail.actionbuttons', |
71 | - function ($event) { |
|
71 | + function($event) { |
|
72 | 72 | return 'pdf/application/details/button'; |
73 | 73 | } |
74 | 74 | ); |
@@ -148,9 +148,9 @@ discard block |
||
148 | 148 | { |
149 | 149 | $file = $e->getLastFileObject(); |
150 | 150 | // assume it is of the class Core\Entity\FileEntity |
151 | - $return = '<div class="col-md-3"><a href="#attachment_' . $file->getId() . '">' . $file->getName() . '</a></div>' . PHP_EOL |
|
152 | - . '<div class="col-md-3">' . $file->getType() . '</div>' |
|
153 | - . '<div class="col-md-3">' . $file->prettySize . '</div>'; |
|
151 | + $return = '<div class="col-md-3"><a href="#attachment_'.$file->getId().'">'.$file->getName().'</a></div>'.PHP_EOL |
|
152 | + . '<div class="col-md-3">'.$file->getType().'</div>' |
|
153 | + . '<div class="col-md-3">'.$file->prettySize.'</div>'; |
|
154 | 154 | /* |
155 | 155 | * this snippet was for direct inserting an image into the PDF |
156 | 156 | if ($file && $file instanceOf FileEntity && 0 === strpos($file->getType(), 'image')) { |
@@ -250,7 +250,7 @@ discard block |
||
250 | 250 | |
251 | 251 | // the handles are for temporary files |
252 | 252 | error_reporting(0); |
253 | - foreach (array(self::RENDER_FULL, self::RENDER_WITHOUT_PDF, self::RENDER_WITHOUT_ATTACHMENTS ) as $render) { |
|
253 | + foreach (array(self::RENDER_FULL, self::RENDER_WITHOUT_PDF, self::RENDER_WITHOUT_ATTACHMENTS) as $render) { |
|
254 | 254 | $handles = array(); |
255 | 255 | try { |
256 | 256 | $pdf = new Mpdf(); |
@@ -264,8 +264,8 @@ discard block |
||
264 | 264 | if (is_array($this->appendImage) && !empty($this->appendImage)) { |
265 | 265 | foreach ($this->appendImage as $imageAttachment) { |
266 | 266 | $content = $imageAttachment->getContent(); |
267 | - $url = 'data:image/' . $imageAttachment->getType() . ';base64,' . base64_encode($content); |
|
268 | - $html = '<a name="attachment_' . $imageAttachment->getId() . '"><img src="' . $url . '" /><br /></a>'; |
|
267 | + $url = 'data:image/'.$imageAttachment->getType().';base64,'.base64_encode($content); |
|
268 | + $html = '<a name="attachment_'.$imageAttachment->getId().'"><img src="'.$url.'" /><br /></a>'; |
|
269 | 269 | $pdf->WriteHTML($html); |
270 | 270 | } |
271 | 271 | } |
@@ -292,7 +292,7 @@ discard block |
||
292 | 292 | $pagecount = $pdf->SetSourceFile($filename); |
293 | 293 | for ($pages = 0; $pages < $pagecount; $pages++) { |
294 | 294 | $pdf->AddPage(); |
295 | - $pdf->WriteHTML(' pages: ' . $pagecount); |
|
295 | + $pdf->WriteHTML(' pages: '.$pagecount); |
|
296 | 296 | $tx = $pdf->ImportPage($pages + 1); |
297 | 297 | $pdf->UseTemplate($tx); |
298 | 298 | } |
@@ -329,18 +329,18 @@ discard block |
||
329 | 329 | $defaultSuffix = $viewTemplatePathStack->getDefaultSuffix(); |
330 | 330 | if (pathinfo($name, PATHINFO_EXTENSION) != $defaultSuffix) { |
331 | 331 | ; |
332 | - $name .= '.pdf.' . $defaultSuffix; |
|
332 | + $name .= '.pdf.'.$defaultSuffix; |
|
333 | 333 | } else { |
334 | 334 | // TODO: replace Filename by Filename for PDF |
335 | 335 | } |
336 | 336 | |
337 | 337 | foreach ($paths as $path) { |
338 | - $file = new SplFileInfo($path . $name); |
|
338 | + $file = new SplFileInfo($path.$name); |
|
339 | 339 | if ($file->isReadable()) { |
340 | 340 | // Found! Return it. |
341 | 341 | if (($filePath = $file->getRealPath()) === false && substr($path, 0, 7) === 'phar://') { |
342 | 342 | // Do not try to expand phar paths (realpath + phars == fail) |
343 | - $filePath = $path . $name; |
|
343 | + $filePath = $path.$name; |
|
344 | 344 | if (!file_exists($filePath)) { |
345 | 345 | break; |
346 | 346 | } |