@@ -40,7 +40,7 @@ |
||
40 | 40 | } |
41 | 41 | |
42 | 42 | /** |
43 | - * @param object|Bootstrap $bootstrap |
|
43 | + * @param Bootstrap $bootstrap |
|
44 | 44 | * @param callable $trigger |
45 | 45 | * @return AbstractConfiguredApplication |
46 | 46 | * @triggers bootstrap |
@@ -52,6 +52,7 @@ discard block |
||
52 | 52 | |
53 | 53 | /** |
54 | 54 | * {@inheritdoc} |
55 | + * @param string $factory |
|
55 | 56 | */ |
56 | 57 | public function set($service, $factory = null) |
57 | 58 | { |
@@ -116,7 +117,7 @@ discard block |
||
116 | 117 | } |
117 | 118 | |
118 | 119 | /** |
119 | - * @param $service |
|
120 | + * @param string $service |
|
120 | 121 | */ |
121 | 122 | private function setService($service) |
122 | 123 | { |
@@ -57,7 +57,7 @@ |
||
57 | 57 | |
58 | 58 | /** |
59 | 59 | * @param DebuggerInterface $debugger |
60 | - * @return mixed|DebuggerInterface|\WebinoAppLib\Service\NullDebugger |
|
60 | + * @return DebuggerInterface|null |
|
61 | 61 | */ |
62 | 62 | private function createDebugger(DebuggerInterface $debugger = null) |
63 | 63 | { |
@@ -59,7 +59,7 @@ |
||
59 | 59 | } |
60 | 60 | |
61 | 61 | /** |
62 | - * @param object|IBarPanel $panel |
|
62 | + * @param IBarPanel $panel |
|
63 | 63 | * @param string|null $id |
64 | 64 | * @return $this |
65 | 65 | */ |
@@ -35,7 +35,6 @@ |
||
35 | 35 | /** |
36 | 36 | * @param string $name Name of adapter service. |
37 | 37 | * @param string $type |
38 | - * @param array $opt$this->htmlions |
|
39 | 38 | * @return $this |
40 | 39 | */ |
41 | 40 | protected function configureAdapter($name, $type, array $options = []) |
@@ -57,7 +57,7 @@ |
||
57 | 57 | } |
58 | 58 | |
59 | 59 | /** |
60 | - * @param $title |
|
60 | + * @param string $title |
|
61 | 61 | * @return $this |
62 | 62 | */ |
63 | 63 | public function setTitle($title) |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | $styleData = []; |
87 | 87 | |
88 | 88 | if (!empty($this->attribs['style'])) { |
89 | - call_user_func(function () use (&$styleData) { |
|
89 | + call_user_func(function() use (&$styleData) { |
|
90 | 90 | foreach (explode(';', $this->attribs['style']) as $pair) { |
91 | 91 | list($name, $value) = explode(':', $pair); |
92 | 92 | $styleData[trim($name)] = trim($value); |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | |
109 | 109 | $stylePairs = []; |
110 | 110 | foreach ($styleData as $name => $value) { |
111 | - $stylePairs[] = $name . ': ' . $value; |
|
111 | + $stylePairs[] = $name.': '.$value; |
|
112 | 112 | } |
113 | 113 | |
114 | 114 | $this->setAttribute('style', join('; ', $stylePairs)); |
@@ -44,11 +44,11 @@ discard block |
||
44 | 44 | //dd($app->url('something', ['paramtest' => '123456'])); |
45 | 45 | |
46 | 46 | |
47 | -$app->bind(RouteEvent::NO_MATCH, function (DispatchEvent $event) { |
|
47 | +$app->bind(RouteEvent::NO_MATCH, function(DispatchEvent $event) { |
|
48 | 48 | $event->setResponse('404 NOT FOUND'); |
49 | 49 | }); |
50 | 50 | |
51 | -$app->bind(DefaultRoute::class, function (RouteEvent $event) use ($app) { |
|
51 | +$app->bind(DefaultRoute::class, function(RouteEvent $event) use ($app) { |
|
52 | 52 | |
53 | 53 | $event->setResponse('<p>Default Route</p>'); |
54 | 54 | |
@@ -60,16 +60,16 @@ discard block |
||
60 | 60 | // echo '<p>Default Something</p>'; |
61 | 61 | //}); |
62 | 62 | |
63 | -$app->bindRoute('something', function (RouteEvent $event) { |
|
63 | +$app->bindRoute('something', function(RouteEvent $event) { |
|
64 | 64 | |
65 | 65 | // dd($event->getRequest()->getBaseUrl()); |
66 | 66 | |
67 | 67 | // dd($event->getRouteParam('paramtest')); |
68 | 68 | |
69 | - $event->setResponse('<p>Default Something X ' . $event->getParam('paramtest') . '</p>'); |
|
69 | + $event->setResponse('<p>Default Something X '.$event->getParam('paramtest').'</p>'); |
|
70 | 70 | }, AppEvent::FINISH); |
71 | 71 | |
72 | -$app->bindRoute('something', function (RouteEvent $event) use ($app) { |
|
72 | +$app->bindRoute('something', function(RouteEvent $event) use ($app) { |
|
73 | 73 | $event->setResponse('<p>Default Something 2</p>'); |
74 | 74 | $event->setResponse($app->url(DefaultRoute::class)->html('Test link to home')->setTitle('Bla bla bla')->setClass('x')); |
75 | 75 | |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | |
84 | 84 | // TODO route lisetner |
85 | 85 | |
86 | -$app->bind(AppEvent::DISPATCH, function (DispatchEvent $event) use ($app) { |
|
86 | +$app->bind(AppEvent::DISPATCH, function(DispatchEvent $event) use ($app) { |
|
87 | 87 | |
88 | 88 | // dd($event->getApp()); |
89 | 89 | // dd($event->getRequest()); |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | |
150 | 150 | // TODO |
151 | 151 | //$app->bind(DrawEvent::RENDER, function (DrawEvent $event) { |
152 | -$app->bind('render.html', function (DispatchEvent $event) { |
|
152 | +$app->bind('render.html', function(DispatchEvent $event) { |
|
153 | 153 | |
154 | 154 | /** @var \WebinoDomLib\Dom $html */ |
155 | 155 | $doc = $event->getParam('doc'); |
@@ -181,8 +181,8 @@ discard block |
||
181 | 181 | |
182 | 182 | }); |
183 | 183 | |
184 | -$app->bind(DefaultRoute::class, function () use ($app) { |
|
185 | - $app->bind('render.html', function (DispatchEvent $event) { |
|
184 | +$app->bind(DefaultRoute::class, function() use ($app) { |
|
185 | + $app->bind('render.html', function(DispatchEvent $event) { |
|
186 | 186 | |
187 | 187 | /** @var \WebinoDomLib\Dom $doc */ |
188 | 188 | $doc = $event->getParam('doc'); |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | }); |
198 | 198 | |
199 | 199 | // TODO HTML layout listener |
200 | -$app->bind(AppEvent::DISPATCH, function (DispatchEvent $event) { |
|
200 | +$app->bind(AppEvent::DISPATCH, function(DispatchEvent $event) { |
|
201 | 201 | |
202 | 202 | $content = $event->getResponse()->getContent(); |
203 | 203 | |
@@ -236,7 +236,7 @@ discard block |
||
236 | 236 | $events = $renderer->getEventManager(); |
237 | 237 | |
238 | 238 | // setting a value |
239 | - $events->attach('render', function ($event) { |
|
239 | + $events->attach('render', function($event) { |
|
240 | 240 | |
241 | 241 | $node = $event->getParam('node'); |
242 | 242 | $spec = $event->getParam('spec'); |
@@ -246,7 +246,7 @@ discard block |
||
246 | 246 | }); |
247 | 247 | |
248 | 248 | // setting an html |
249 | - $events->attach('render', function ($event) { |
|
249 | + $events->attach('render', function($event) { |
|
250 | 250 | |
251 | 251 | $node = $event->getParam('node'); |
252 | 252 | $spec = $event->getParam('spec'); |
@@ -254,14 +254,14 @@ discard block |
||
254 | 254 | |
255 | 255 | // todo replace placeholders |
256 | 256 | $innerHtml = $node->getInnerHtml(); |
257 | - $html = $innerHtml . $html; |
|
257 | + $html = $innerHtml.$html; |
|
258 | 258 | |
259 | 259 | empty($html) or $node->setHtml($html); |
260 | 260 | }); |
261 | 261 | |
262 | 262 | // TODO components render listener |
263 | 263 | // components |
264 | - $events->attach('render', function (\Zend\EventManager\Event $event) { |
|
264 | + $events->attach('render', function(\Zend\EventManager\Event $event) { |
|
265 | 265 | /** @var \WebinoDomLib\State\Spec $spec */ |
266 | 266 | $spec = $event->getParam('spec'); |
267 | 267 | |
@@ -276,13 +276,13 @@ discard block |
||
276 | 276 | if (class_exists($options['component'])) { |
277 | 277 | $events->trigger($options['component'], $event); |
278 | 278 | } else { |
279 | - $events->trigger('render.component.' . $options['component'], $event); |
|
279 | + $events->trigger('render.component.'.$options['component'], $event); |
|
280 | 280 | } |
281 | 281 | |
282 | 282 | }, DispatchEvent::BEGIN * 9); |
283 | 283 | |
284 | 284 | // resolve components data |
285 | - $events->attach(\WebinoDrawLib\Feature\TableDraw::class, function ($event) { |
|
285 | + $events->attach(\WebinoDrawLib\Feature\TableDraw::class, function($event) { |
|
286 | 286 | $spec = $event->getParam('spec'); |
287 | 287 | if (!$spec->hasOption('data')) { |
288 | 288 | return; |
@@ -307,7 +307,7 @@ discard block |
||
307 | 307 | }); |
308 | 308 | |
309 | 309 | // table component |
310 | - $events->attach(\WebinoDrawLib\Feature\TableDraw::class, function (\Zend\EventManager\Event $event) { |
|
310 | + $events->attach(\WebinoDrawLib\Feature\TableDraw::class, function(\Zend\EventManager\Event $event) { |
|
311 | 311 | |
312 | 312 | /** @var \WebinoDomLib\Dom\Element $node */ |
313 | 313 | $node = $event->getParam('node'); |
@@ -316,7 +316,7 @@ discard block |
||
316 | 316 | |
317 | 317 | // todo replace placeholders |
318 | 318 | $innerHtml = $node->getInnerHtml(); |
319 | - $html = $innerHtml . $html; |
|
319 | + $html = $innerHtml.$html; |
|
320 | 320 | |
321 | 321 | $data = $event->getParam('data', []); |
322 | 322 | if (empty($data)) { |
@@ -333,16 +333,16 @@ discard block |
||
333 | 333 | // todo configurable locators |
334 | 334 | $table = $doc->locate('table'); |
335 | 335 | $table->locate('thead th') |
336 | - ->loop(array_keys(current($data)), function (\WebinoDomLib\Dom\NodeList $node, $data) { |
|
336 | + ->loop(array_keys(current($data)), function(\WebinoDomLib\Dom\NodeList $node, $data) { |
|
337 | 337 | // TODO emit event |
338 | 338 | $node->setValue($data); |
339 | 339 | }); |
340 | 340 | |
341 | 341 | $table->locate('tbody tr') |
342 | - ->loop($data, function (\WebinoDomLib\Dom\NodeList $node, $data) { |
|
342 | + ->loop($data, function(\WebinoDomLib\Dom\NodeList $node, $data) { |
|
343 | 343 | |
344 | 344 | $node->locate('td') |
345 | - ->loop($data, function (\WebinoDomLib\Dom\NodeList $node, $data) { |
|
345 | + ->loop($data, function(\WebinoDomLib\Dom\NodeList $node, $data) { |
|
346 | 346 | // TODO emit event |
347 | 347 | $node->setValue($data); |
348 | 348 | }); |
@@ -375,7 +375,7 @@ discard block |
||
375 | 375 | |
376 | 376 | //$app->bind(AppEvent::DISPATCH, MyListener::class, AppEvent::BEGIN); |
377 | 377 | |
378 | -$app->bind(AppEvent::DISPATCH, function () use ($app) { |
|
378 | +$app->bind(AppEvent::DISPATCH, function() use ($app) { |
|
379 | 379 | // undefined(); |
380 | 380 | // echo 'Svet'; |
381 | 381 |
@@ -26,15 +26,15 @@ discard block |
||
26 | 26 | { |
27 | 27 | public function init() |
28 | 28 | { |
29 | - $this->listen(AppEvent::DISPATCH, function (DispatchEvent $event) { |
|
29 | + $this->listen(AppEvent::DISPATCH, function(DispatchEvent $event) { |
|
30 | 30 | $event->setResponse($event->getApp()->file()->read('docs/common.html')); |
31 | 31 | }, AppEvent::BEGIN); |
32 | 32 | |
33 | - $this->listen(AppEvent::DISPATCH, function (DispatchEvent $event) { |
|
33 | + $this->listen(AppEvent::DISPATCH, function(DispatchEvent $event) { |
|
34 | 34 | $event->setResponse($event->getApp()->file()->read('docs/footer.html')); |
35 | 35 | }, AppEvent::FINISH); |
36 | 36 | |
37 | - $this->listen(DefaultRoute::class, function (RouteEvent $event) { |
|
37 | + $this->listen(DefaultRoute::class, function(RouteEvent $event) { |
|
38 | 38 | $event->setResponse([ |
39 | 39 | '<h1>Webino Application Basic Usage Example</h1>', |
40 | 40 | $event->getApp()->url('myRoute')->html('My Route Example'), |
@@ -43,14 +43,14 @@ discard block |
||
43 | 43 | ]); |
44 | 44 | }); |
45 | 45 | |
46 | - $this->listen(RouteEvent::MATCH, function (RouteEvent $event) { |
|
46 | + $this->listen(RouteEvent::MATCH, function(RouteEvent $event) { |
|
47 | 47 | $routeName = $event->getRouteMatch()->getMatchedRouteName(); |
48 | 48 | if (DefaultRoute::class === $routeName) { |
49 | 49 | $routeName = 'default'; |
50 | 50 | } |
51 | 51 | |
52 | 52 | $file = $event->getApp()->file(); |
53 | - $path = 'docs/' . $routeName . '.html'; |
|
53 | + $path = 'docs/'.$routeName.'.html'; |
|
54 | 54 | |
55 | 55 | if ($file->has($path)) { |
56 | 56 | $docs = $file->read($path); |
@@ -58,17 +58,17 @@ discard block |
||
58 | 58 | } |
59 | 59 | }, RouteEvent::FINISH); |
60 | 60 | |
61 | - $this->listen(RouteEvent::MATCH, function (RouteEvent $event) { |
|
61 | + $this->listen(RouteEvent::MATCH, function(RouteEvent $event) { |
|
62 | 62 | if (DefaultRoute::class !== $event->getRouteMatch()->getMatchedRouteName()) { |
63 | 63 | $event->setResponse($event->getApp()->url(DefaultRoute::class)->html('Go Home')); |
64 | 64 | } |
65 | 65 | }, RouteEvent::FINISH); |
66 | 66 | |
67 | - $this->listenRoute('myRoute', function (RouteEvent $event) { |
|
67 | + $this->listenRoute('myRoute', function(RouteEvent $event) { |
|
68 | 68 | $event->setResponse('<h1>My Route Example Content</h1>'); |
69 | 69 | }); |
70 | 70 | |
71 | - $this->listenRoute('myRuntimeRoute', function (RouteEvent $event) { |
|
71 | + $this->listenRoute('myRuntimeRoute', function(RouteEvent $event) { |
|
72 | 72 | $event->setResponse([ |
73 | 73 | '<h1>My Runtime Route Example Content</h1>', |
74 | 74 | ]); |
@@ -97,6 +97,6 @@ discard block |
||
97 | 97 | // runtime route example |
98 | 98 | $app->route('myRuntimeRoute')->setLiteral('/my-runtime-route'); |
99 | 99 | |
100 | -require __DIR__ . '/dispatch.php'; |
|
100 | +require __DIR__.'/dispatch.php'; |
|
101 | 101 | |
102 | 102 | $app->dispatch(); |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | use WebinoExamplesLib\Html\ConsolePreview; |
14 | 14 | use WebinoHtmlLib\Html; |
15 | 15 | |
16 | -require __DIR__ . '/../../vendor/autoload.php'; |
|
16 | +require __DIR__.'/../../vendor/autoload.php'; |
|
17 | 17 | |
18 | 18 | /** |
19 | 19 | * Custom console command class |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | |
116 | 116 | $app = Webino::application($config)->bootstrap(); |
117 | 117 | |
118 | -$app->bind(DefaultRoute::class, function (RouteEvent $event) { |
|
118 | +$app->bind(DefaultRoute::class, function(RouteEvent $event) { |
|
119 | 119 | $event->setResponse([ |
120 | 120 | new Html\Text('Use Command Line Interface!'), |
121 | 121 | new ConsolePreview('preview.jpg'), |