@@ -7,14 +7,14 @@ |
||
7 | 7 | /** |
8 | 8 | * @var array $bootLoaders |
9 | 9 | */ |
10 | - protected static $bootLoaders = ['url','logger']; |
|
10 | + protected static $bootLoaders = ['url', 'logger']; |
|
11 | 11 | |
12 | 12 | /** |
13 | 13 | * load bootstrapper dependencies |
14 | 14 | * |
15 | 15 | * @param array $loaders |
16 | 16 | */ |
17 | - public static function bootLoader($loaders=array()) |
|
17 | + public static function bootLoader($loaders = array()) |
|
18 | 18 | { |
19 | 19 | app()->loadIfNotExistBoot($loaders); |
20 | 20 | } |
@@ -22,13 +22,13 @@ discard block |
||
22 | 22 | * @param $class |
23 | 23 | * @return mixed |
24 | 24 | */ |
25 | - public function macro($class) |
|
26 | - { |
|
27 | - $this->class = $class; |
|
28 | - $this->macro = $this; |
|
25 | + public function macro($class) |
|
26 | + { |
|
27 | + $this->class = $class; |
|
28 | + $this->macro = $this; |
|
29 | 29 | |
30 | - return $this; |
|
31 | - } |
|
30 | + return $this; |
|
31 | + } |
|
32 | 32 | |
33 | 33 | /** |
34 | 34 | * get macro property |
@@ -36,10 +36,10 @@ discard block |
||
36 | 36 | * @param $name |
37 | 37 | * @return mixed |
38 | 38 | */ |
39 | - public function __get($name) |
|
40 | - { |
|
41 | - return ClosureDispatcher::bind($this->class)->call(function() use($name){ |
|
42 | - return $this->{$name}; |
|
43 | - }); |
|
44 | - } |
|
39 | + public function __get($name) |
|
40 | + { |
|
41 | + return ClosureDispatcher::bind($this->class)->call(function() use($name){ |
|
42 | + return $this->{$name}; |
|
43 | + }); |
|
44 | + } |
|
45 | 45 | } |
46 | 46 | \ No newline at end of file |
@@ -24,7 +24,7 @@ |
||
24 | 24 | */ |
25 | 25 | public function macro($class) |
26 | 26 | { |
27 | - $this->class = $class; |
|
27 | + $this->class = $class; |
|
28 | 28 | $this->macro = $this; |
29 | 29 | |
30 | 30 | return $this; |
@@ -36,10 +36,10 @@ |
||
36 | 36 | return $this->yaml; |
37 | 37 | } |
38 | 38 | |
39 | - public function set($data=array()) |
|
39 | + public function set($data = array()) |
|
40 | 40 | { |
41 | 41 | //we merge the data in yaml with new data. |
42 | - $newYamlData = array_merge($this->yaml,$data); |
|
42 | + $newYamlData = array_merge($this->yaml, $data); |
|
43 | 43 | |
44 | 44 | //we dump new data. |
45 | 45 | $yaml = Yaml::dump($newYamlData); |
@@ -33,8 +33,9 @@ |
||
33 | 33 | */ |
34 | 34 | public function call(\Closure $closure) |
35 | 35 | { |
36 | - if(!is_null($this->bind)) |
|
37 | - $closure = \Closure::bind($closure, $this->bind, $this->bind); |
|
36 | + if(!is_null($this->bind)) { |
|
37 | + $closure = \Closure::bind($closure, $this->bind, $this->bind); |
|
38 | + } |
|
38 | 39 | return $closure(); |
39 | 40 | } |
40 | 41 | } |
41 | 42 | \ No newline at end of file |
@@ -35,7 +35,7 @@ |
||
35 | 35 | */ |
36 | 36 | public function call(\Closure $closure) |
37 | 37 | { |
38 | - if(!is_null($this->bind)) |
|
38 | + if (!is_null($this->bind)) |
|
39 | 39 | $closure = \Closure::bind($closure, $this->bind, $this->bind); |
40 | 40 | return $closure(); |
41 | 41 | } |
@@ -1,7 +1,7 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | //root definer: application root path |
4 | -define("root",str_replace("\\","/",realpath(__DIR__.'/'))); |
|
4 | +define("root", str_replace("\\", "/", realpath(__DIR__.'/'))); |
|
5 | 5 | |
6 | 6 | /** |
7 | 7 | * resta system composer vendor autoload. |
@@ -33,9 +33,9 @@ |
||
33 | 33 | { |
34 | 34 | $inputs = $this->app->get($this->method); |
35 | 35 | |
36 | - $content = json_decode($this->app['request']->getContent(),1); |
|
36 | + $content = json_decode($this->app['request']->getContent(), 1); |
|
37 | 37 | |
38 | - if(is_array($inputs) && count($inputs)){ |
|
38 | + if (is_array($inputs) && count($inputs)) { |
|
39 | 39 | return $inputs; |
40 | 40 | } |
41 | 41 |
@@ -48,20 +48,20 @@ discard block |
||
48 | 48 | |
49 | 49 | //Now, let's get our custom boot list. |
50 | 50 | //Let's assign the final state to our booterList list along with our custom boot list. |
51 | - foreach (array_keys($this->getBootDirectory()) as $customBoots){ |
|
51 | + foreach (array_keys($this->getBootDirectory()) as $customBoots) { |
|
52 | 52 | |
53 | 53 | //We assign the namespace data of the bootable class to the bootNamespace property. |
54 | - $this->bootNamespace=''.StaticPathList::$boot.'\\'.$customBoots; |
|
54 | + $this->bootNamespace = ''.StaticPathList::$boot.'\\'.$customBoots; |
|
55 | 55 | |
56 | 56 | //Your custom boot objects in |
57 | 57 | //the boot directory should not be in the middlewaregroups list. |
58 | - if(false===app()->console() && !in_array($this->bootNamespace,$booterList)){ |
|
58 | + if (false===app()->console() && !in_array($this->bootNamespace, $booterList)) { |
|
59 | 59 | $this->booterManifest(); |
60 | 60 | } |
61 | 61 | } |
62 | 62 | |
63 | 63 | //The booterList property combines booterList variables. |
64 | - return array_merge($booterList,$this->booterList); |
|
64 | + return array_merge($booterList, $this->booterList); |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | /** |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | { |
73 | 73 | //if the boot list belongs to the custom booter, |
74 | 74 | //then we can boot our custom boot objects by adding them at the end of this class. |
75 | - if(array_pop($booter)==$this->customBooter){ |
|
75 | + if (array_pop($booter)==$this->customBooter) { |
|
76 | 76 | return $this->addCustomBooter(); |
77 | 77 | } |
78 | 78 |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | */ |
21 | 21 | public static function clientVersion() |
22 | 22 | { |
23 | - if(defined('version')){ |
|
23 | + if (defined('version')) { |
|
24 | 24 | return version; |
25 | 25 | } |
26 | 26 | |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | */ |
45 | 45 | public static function getConsoleVersion() |
46 | 46 | { |
47 | - if(Utils::isNamespaceExists(self::versionNamespace()) && method_exists(self::versionNamespace(),'consoleVersion')){ |
|
47 | + if (Utils::isNamespaceExists(self::versionNamespace()) && method_exists(self::versionNamespace(), 'consoleVersion')) { |
|
48 | 48 | return self::versionNamespace()::consoleVersion(); |
49 | 49 | } |
50 | 50 | |
@@ -55,9 +55,9 @@ discard block |
||
55 | 55 | * @param array $versions |
56 | 56 | * @return array |
57 | 57 | */ |
58 | - private static function getSupportedVersions($versions=array()) |
|
58 | + private static function getSupportedVersions($versions = array()) |
|
59 | 59 | { |
60 | - if(count($versions)){ |
|
60 | + if (count($versions)) { |
|
61 | 61 | return $versions; |
62 | 62 | } |
63 | 63 | return self::$supportedVersions; |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | * @param array $versions |
70 | 70 | * @return mixed |
71 | 71 | */ |
72 | - public static function supportedVersions($versions=array()) |
|
72 | + public static function supportedVersions($versions = array()) |
|
73 | 73 | { |
74 | 74 | return self::versionNamespace()::getSupportedVersions($versions); |
75 | 75 | } |
@@ -81,11 +81,11 @@ discard block |
||
81 | 81 | */ |
82 | 82 | public static function version() |
83 | 83 | { |
84 | - if(self::clientVersion()!==null){ |
|
84 | + if (self::clientVersion()!==null) { |
|
85 | 85 | return self::clientVersion(); |
86 | 86 | } |
87 | 87 | |
88 | - if(app()->console() && self::getConsoleVersion()!==null){ |
|
88 | + if (app()->console() && self::getConsoleVersion()!==null) { |
|
89 | 89 | return self::getConsoleVersion(); |
90 | 90 | } |
91 | 91 | |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | */ |
100 | 100 | public static function versionNamespace() |
101 | 101 | { |
102 | - if(file_exists(app()->path()->kernel())){ |
|
102 | + if (file_exists(app()->path()->kernel())) { |
|
103 | 103 | return app()->namespace()->kernel().'\Version'; |
104 | 104 | } |
105 | 105 |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | * LoggerHandler constructor. |
27 | 27 | * @param null $file |
28 | 28 | */ |
29 | - public function __construct($file=null) |
|
29 | + public function __construct($file = null) |
|
30 | 30 | { |
31 | 31 | $this->file = $file; |
32 | 32 | $this->logger = core()->loggerService; |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | */ |
52 | 52 | public function alert($message, array $context = []) |
53 | 53 | { |
54 | - $this->writeLog(__FUNCTION__,$message,$context); |
|
54 | + $this->writeLog(__FUNCTION__, $message, $context); |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | /** |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | */ |
64 | 64 | public function critical($message, array $context = []) |
65 | 65 | { |
66 | - $this->writeLog(__FUNCTION__,$message,$context); |
|
66 | + $this->writeLog(__FUNCTION__, $message, $context); |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | /** |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | */ |
76 | 76 | public function debug($message, array $context = []) |
77 | 77 | { |
78 | - $this->writeLog(__FUNCTION__,$message,$context); |
|
78 | + $this->writeLog(__FUNCTION__, $message, $context); |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | /** |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | */ |
88 | 88 | public function emergency($message, array $context = []) |
89 | 89 | { |
90 | - $this->writeLog(__FUNCTION__,$message,$context); |
|
90 | + $this->writeLog(__FUNCTION__, $message, $context); |
|
91 | 91 | } |
92 | 92 | |
93 | 93 | /** |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | */ |
100 | 100 | public function error($message, array $context = []) |
101 | 101 | { |
102 | - $this->writeLog(__FUNCTION__,$message,$context); |
|
102 | + $this->writeLog(__FUNCTION__, $message, $context); |
|
103 | 103 | } |
104 | 104 | |
105 | 105 | /** |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | */ |
112 | 112 | public function info($message, array $context = []) |
113 | 113 | { |
114 | - $this->writeLog(__FUNCTION__,$message,$context); |
|
114 | + $this->writeLog(__FUNCTION__, $message, $context); |
|
115 | 115 | } |
116 | 116 | |
117 | 117 | /** |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | */ |
136 | 136 | public function notice($message, array $context = []) |
137 | 137 | { |
138 | - $this->writeLog(__FUNCTION__,$message,$context); |
|
138 | + $this->writeLog(__FUNCTION__, $message, $context); |
|
139 | 139 | } |
140 | 140 | |
141 | 141 | /** |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | */ |
148 | 148 | public function warning($message, array $context = []) |
149 | 149 | { |
150 | - $this->writeLog(__FUNCTION__,$message,$context); |
|
150 | + $this->writeLog(__FUNCTION__, $message, $context); |
|
151 | 151 | } |
152 | 152 | |
153 | 153 | /** |
@@ -158,11 +158,11 @@ discard block |
||
158 | 158 | * @param $context |
159 | 159 | * @return void |
160 | 160 | */ |
161 | - protected function writeLog($level, $message,$context) |
|
161 | + protected function writeLog($level, $message, $context) |
|
162 | 162 | { |
163 | 163 | $file = ($this->file===null) ? $level : $this->file; |
164 | 164 | |
165 | - if($this->adapter!==null){ |
|
165 | + if ($this->adapter!==null) { |
|
166 | 166 | |
167 | 167 | $adapter = $this->adapter; |
168 | 168 | |
@@ -171,8 +171,8 @@ discard block |
||
171 | 171 | }); |
172 | 172 | } |
173 | 173 | |
174 | - if($this->logger!==null){ |
|
175 | - $this->logger->logHandler($message,$file,$level); |
|
174 | + if ($this->logger!==null) { |
|
175 | + $this->logger->logHandler($message, $file, $level); |
|
176 | 176 | } |
177 | 177 | |
178 | 178 | return $context; |