@@ -78,7 +78,7 @@ |
||
78 | 78 | ->setTo('me@localhost')->setSubject('Hi')->setBody('Hello')->mail(); |
79 | 79 | |
80 | 80 | $info['newTemplateMail[mail]=1'] = $this->di('mailer')->newTemplateMail('mail.template') |
81 | - ->setTo('me@localhost')->setSubject('Hi')->mail(); |
|
81 | + ->setTo('me@localhost')->setSubject('Hi')->mail(); |
|
82 | 82 | |
83 | 83 | return '<pre>' . print_r($info, 1) . '</pre>' |
84 | 84 | . '<p>You can check mail logs in <code>example/.var/mail/</code></p>'; |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | { |
53 | 53 | $this->di()->registerAliases([ |
54 | 54 | 'theTwig' => 'twig', |
55 | - 'Phalcon\\Db\\Adapter' => 'db', // needs alias as `NeedsDb` has its name `_db` |
|
55 | + 'Phalcon\\Db\\Adapter' => 'db', // needs alias as `NeedsDb` has its name `_db` |
|
56 | 56 | // Mailer::class => 'mailer', // no need- `DeepNest` uses known name `mailer` |
57 | 57 | ]); |
58 | 58 | |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | $validation = $this->di('validation'); // or $this->di('validator'); |
102 | 102 | |
103 | 103 | // Register new validation rule (if it is used app wide- register when defining in di) |
104 | - $validation->register('gmail', function ($data) { |
|
104 | + $validation->register('gmail', function($data) { |
|
105 | 105 | return stripos($data['email'] ?? '', '@gmail.com') > 0; |
106 | 106 | }, 'Field :field must be an email with @gmail.com'); |
107 | 107 |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | $di = require_once __DIR__ . '/bootstrap.php'; |
15 | 15 | |
16 | 16 | // However we will use simple view here |
17 | -$di->setShared('view', function () { |
|
17 | +$di->setShared('view', function() { |
|
18 | 18 | $view = new SimpleView; |
19 | 19 | |
20 | 20 | $view->setViewsDir($this->get('config')->toArray()['view']['dir']); |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | (new Cors)->boot(); |
52 | 52 | (new Cache)->boot(); |
53 | 53 | |
54 | -$app->notFound(function () use ($di) { |
|
54 | +$app->notFound(function() use ($di) { |
|
55 | 55 | return $di->get('response')->setContent('')->setStatusCode(404); |
56 | 56 | }); |
57 | 57 |
@@ -26,14 +26,14 @@ discard block |
||
26 | 26 | // Setting config in DI is REQUIRED by this package. |
27 | 27 | $di->setShared('config', new Phalcon\Config(require __DIR__ . '/config.php')); |
28 | 28 | |
29 | -$di->setShared('db', function () { |
|
29 | +$di->setShared('db', function() { |
|
30 | 30 | $config = $this->get('config')->toArray(); |
31 | 31 | |
32 | 32 | // PS: If you had already extended your db adapter then imoort trait `PhalconExt\Db\Extension` |
33 | 33 | return (new Sqlite($config['database']))->registerLogger($config['sqllogger']); |
34 | 34 | }); |
35 | 35 | |
36 | -$di->setShared('view', function () { |
|
36 | +$di->setShared('view', function() { |
|
37 | 37 | return (new View) |
38 | 38 | ->setViewsDir($this->get('config')->toArray()['view']['dir']) |
39 | 39 | ->registerEngines([ |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | ]); |
42 | 42 | }); |
43 | 43 | |
44 | -$di->setShared('twig', function () { |
|
44 | +$di->setShared('twig', function() { |
|
45 | 45 | $twig = new Twig($this->get('view'), $this); |
46 | 46 | |
47 | 47 | // Here you can: |
@@ -51,11 +51,11 @@ discard block |
||
51 | 51 | return $twig; |
52 | 52 | }); |
53 | 53 | |
54 | -$di->setShared('mailer', function () { |
|
54 | +$di->setShared('mailer', function() { |
|
55 | 55 | return new Mailer($this->get('config')->toArray()['mail']); |
56 | 56 | }); |
57 | 57 | |
58 | -$di->setShared('redis', function () { |
|
58 | +$di->setShared('redis', function() { |
|
59 | 59 | return new Redis(new CacheFront(['lifetime' => 0])); |
60 | 60 | }); |
61 | 61 |
@@ -125,11 +125,11 @@ |
||
125 | 125 | */ |
126 | 126 | protected function getMessageParts(\Swift_Mime_SimpleMessage $message) |
127 | 127 | { |
128 | - $attachments = \array_filter($message->getChildren(), function ($part) { |
|
128 | + $attachments = \array_filter($message->getChildren(), function($part) { |
|
129 | 129 | return $part instanceof \Swift_Attachment; |
130 | 130 | }); |
131 | 131 | |
132 | - $attachments = \array_map(function ($part) { |
|
132 | + $attachments = \array_map(function($part) { |
|
133 | 133 | return $part->getName(); |
134 | 134 | }, $attachments); |
135 | 135 |