@@ -10,7 +10,7 @@ |
||
10 | 10 | */ |
11 | 11 | function dd() |
12 | 12 | { |
13 | - array_map(function ($x) { |
|
13 | + array_map(function($x) { |
|
14 | 14 | $string = (new Dump(null, true))->variable($x); |
15 | 15 | |
16 | 16 | echo PHP_SAPI == 'cli' ? strip_tags($string).PHP_EOL : $string; |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | { |
82 | 82 | $ran = $this->getRan($ran, $steps); |
83 | 83 | |
84 | - return array_map(function ($item) { |
|
84 | + return array_map(function($item) { |
|
85 | 85 | return $item['migration']; |
86 | 86 | }, $ran); |
87 | 87 | } |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | { |
98 | 98 | $ran = $this->getRan($ran); |
99 | 99 | |
100 | - return array_map(function ($item) { |
|
100 | + return array_map(function($item) { |
|
101 | 101 | return $item['batch']; |
102 | 102 | }, $ran); |
103 | 103 | } |
@@ -99,11 +99,11 @@ |
||
99 | 99 | { |
100 | 100 | $files = scandir($this->config->getMigrationDirectory()); |
101 | 101 | |
102 | - $files = array_filter($files, function ($file) { |
|
102 | + $files = array_filter($files, function($file) { |
|
103 | 103 | return strpos($file, '.php') !== false; |
104 | 104 | }); |
105 | 105 | |
106 | - $files = array_map(function ($file) { |
|
106 | + $files = array_map(function($file) { |
|
107 | 107 | return str_replace('.php', '', $file); |
108 | 108 | }, $files); |
109 | 109 |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | } |
97 | 97 | |
98 | 98 | if (is_array($made)) { |
99 | - return array_map(function (Model $model) { |
|
99 | + return array_map(function(Model $model) { |
|
100 | 100 | $model->save(); |
101 | 101 | |
102 | 102 | return $model; |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | */ |
155 | 155 | protected function callClosureAttributes(array $attributes) |
156 | 156 | { |
157 | - return array_map(function ($attribute) use ($attributes) { |
|
157 | + return array_map(function($attribute) use ($attributes) { |
|
158 | 158 | if ($attribute instanceof \Closure) { |
159 | 159 | return $attribute($attributes); |
160 | 160 | } |
@@ -7,12 +7,12 @@ |
||
7 | 7 | use Phalcon\Mvc\Application; |
8 | 8 | use Phalcon\DI\FactoryDefault; |
9 | 9 | |
10 | -$config = include __DIR__ . '/config.php'; |
|
10 | +$config = include __DIR__.'/config.php'; |
|
11 | 11 | |
12 | -include __DIR__ . '/loader.php'; |
|
12 | +include __DIR__.'/loader.php'; |
|
13 | 13 | |
14 | 14 | $di = new FactoryDefault(); |
15 | 15 | |
16 | -include __DIR__ . '/services.php'; |
|
16 | +include __DIR__.'/services.php'; |
|
17 | 17 | |
18 | 18 | return new Application(); |
@@ -107,9 +107,9 @@ |
||
107 | 107 | return new Security(); |
108 | 108 | }); |
109 | 109 | |
110 | - $di->set('modelsManager', function () { |
|
111 | - return new ModelsManager(); |
|
112 | - }); |
|
110 | + $di->set('modelsManager', function () { |
|
111 | + return new ModelsManager(); |
|
112 | + }); |
|
113 | 113 | |
114 | 114 | $di->setShared('yarak', function () { |
115 | 115 | $config = $this->getConfig(); |
@@ -12,11 +12,11 @@ discard block |
||
12 | 12 | use Phalcon\Session\Adapter\Files as SessionAdapter; |
13 | 13 | use Phalcon\Mvc\Model\Metadata\Memory as MetaDataAdapter; |
14 | 14 | |
15 | -$di->setShared('config', function () { |
|
15 | +$di->setShared('config', function() { |
|
16 | 16 | return include APP_PATH.'/config/config.php'; |
17 | 17 | }); |
18 | 18 | |
19 | -$di->setShared('url', function () { |
|
19 | +$di->setShared('url', function() { |
|
20 | 20 | $config = $this->getConfig(); |
21 | 21 | |
22 | 22 | $url = new UrlResolver(); |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | return $url; |
26 | 26 | }); |
27 | 27 | |
28 | -$di->setShared('view', function () { |
|
28 | +$di->setShared('view', function() { |
|
29 | 29 | $config = $this->getConfig(); |
30 | 30 | |
31 | 31 | $view = new View(); |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | $view->setViewsDir($config->application->viewsDir); |
34 | 34 | |
35 | 35 | $view->registerEngines([ |
36 | - '.volt' => function ($view) { |
|
36 | + '.volt' => function($view) { |
|
37 | 37 | $config = $this->getConfig(); |
38 | 38 | |
39 | 39 | $volt = new VoltEngine($view, $this); |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | return $view; |
53 | 53 | }); |
54 | 54 | |
55 | -$di->setShared('db', function () { |
|
55 | +$di->setShared('db', function() { |
|
56 | 56 | $config = $this->getConfig(); |
57 | 57 | |
58 | 58 | $class = 'Phalcon\Db\Adapter\Pdo\\'.$config->database->adapter; |
@@ -76,11 +76,11 @@ discard block |
||
76 | 76 | return $connection; |
77 | 77 | }); |
78 | 78 | |
79 | -$di->setShared('modelsMetadata', function () { |
|
79 | +$di->setShared('modelsMetadata', function() { |
|
80 | 80 | return new MetaDataAdapter(); |
81 | 81 | }); |
82 | 82 | |
83 | -$di->set('flash', function () { |
|
83 | +$di->set('flash', function() { |
|
84 | 84 | return new Flash([ |
85 | 85 | 'error' => 'alert alert-danger', |
86 | 86 | 'success' => 'alert alert-success', |
@@ -89,29 +89,29 @@ discard block |
||
89 | 89 | ]); |
90 | 90 | }); |
91 | 91 | |
92 | -$di->set('session', function () { |
|
92 | +$di->set('session', function() { |
|
93 | 93 | $session = new SessionAdapter(); |
94 | 94 | $session->start(); |
95 | 95 | |
96 | 96 | return $session; |
97 | 97 | }); |
98 | 98 | |
99 | -$di->set('dispatcher', function () { |
|
99 | +$di->set('dispatcher', function() { |
|
100 | 100 | $dispatcher = new Dispatcher(); |
101 | 101 | $dispatcher->setDefaultNamespace('Sonohini\Controllers'); |
102 | 102 | |
103 | 103 | return $dispatcher; |
104 | 104 | }); |
105 | 105 | |
106 | -$di->set('security', function () { |
|
106 | +$di->set('security', function() { |
|
107 | 107 | return new Security(); |
108 | 108 | }); |
109 | 109 | |
110 | - $di->set('modelsManager', function () { |
|
110 | + $di->set('modelsManager', function() { |
|
111 | 111 | return new ModelsManager(); |
112 | 112 | }); |
113 | 113 | |
114 | -$di->setShared('yarak', function () { |
|
114 | +$di->setShared('yarak', function() { |
|
115 | 115 | $config = $this->getConfig(); |
116 | 116 | |
117 | 117 | return new Kernel([ |
@@ -2,8 +2,8 @@ discard block |
||
2 | 2 | |
3 | 3 | use Phalcon\Config; |
4 | 4 | |
5 | -defined('BASE_PATH') || define('BASE_PATH', realpath(dirname(__FILE__) . '/../..')); |
|
6 | -defined('APP_PATH') || define('APP_PATH', BASE_PATH . '/app'); |
|
5 | +defined('BASE_PATH') || define('BASE_PATH', realpath(dirname(__FILE__).'/../..')); |
|
6 | +defined('APP_PATH') || define('APP_PATH', BASE_PATH.'/app'); |
|
7 | 7 | |
8 | 8 | return new Config([ |
9 | 9 | 'database' => [ |
@@ -15,15 +15,15 @@ discard block |
||
15 | 15 | 'charset' => 'utf8', |
16 | 16 | ], |
17 | 17 | 'application' => [ |
18 | - 'appDir' => APP_PATH . '/', |
|
19 | - 'controllersDir' => APP_PATH . '/controllers/', |
|
20 | - 'modelsDir' => APP_PATH . '/models/', |
|
21 | - 'migrationsDir' => APP_PATH . '/database/migrations/', |
|
22 | - 'viewsDir' => APP_PATH . '/views/', |
|
23 | - 'pluginsDir' => APP_PATH . '/plugins/', |
|
24 | - 'servicesDir' => APP_PATH . '/services/', |
|
25 | - 'cacheDir' => BASE_PATH . '/cache/', |
|
26 | - 'formsDir' => APP_PATH . '/forms', |
|
18 | + 'appDir' => APP_PATH.'/', |
|
19 | + 'controllersDir' => APP_PATH.'/controllers/', |
|
20 | + 'modelsDir' => APP_PATH.'/models/', |
|
21 | + 'migrationsDir' => APP_PATH.'/database/migrations/', |
|
22 | + 'viewsDir' => APP_PATH.'/views/', |
|
23 | + 'pluginsDir' => APP_PATH.'/plugins/', |
|
24 | + 'servicesDir' => APP_PATH.'/services/', |
|
25 | + 'cacheDir' => BASE_PATH.'/cache/', |
|
26 | + 'formsDir' => APP_PATH.'/forms', |
|
27 | 27 | 'baseUri' => '/', |
28 | 28 | ] |
29 | 29 | ]); |