@@ -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 | |
@@ -39,18 +39,18 @@ discard block |
||
| 39 | 39 | /** |
| 40 | 40 | * @return mixed |
| 41 | 41 | */ |
| 42 | - public function console(); |
|
| 42 | + public function console(); |
|
| 43 | 43 | |
| 44 | 44 | /** |
| 45 | 45 | * @return mixed |
| 46 | 46 | */ |
| 47 | - public function corePath(); |
|
| 47 | + public function corePath(); |
|
| 48 | 48 | |
| 49 | 49 | /** |
| 50 | 50 | * @param array $environment |
| 51 | 51 | * @return mixed |
| 52 | 52 | */ |
| 53 | - public function environment($environment=array()); |
|
| 53 | + public function environment($environment=array()); |
|
| 54 | 54 | |
| 55 | 55 | /** |
| 56 | 56 | * @param $abstract |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | /** |
| 62 | 62 | * @return mixed |
| 63 | 63 | */ |
| 64 | - public function handle(); |
|
| 64 | + public function handle(); |
|
| 65 | 65 | |
| 66 | 66 | /** |
| 67 | 67 | * @param $abstract |
@@ -74,12 +74,12 @@ discard block |
||
| 74 | 74 | * @param $instance |
| 75 | 75 | * @return mixed |
| 76 | 76 | */ |
| 77 | - public function instance ($abstract,$instance); |
|
| 77 | + public function instance ($abstract,$instance); |
|
| 78 | 78 | |
| 79 | 79 | /** |
| 80 | 80 | * @return mixed |
| 81 | 81 | */ |
| 82 | - public function isLocale(); |
|
| 82 | + public function isLocale(); |
|
| 83 | 83 | |
| 84 | 84 | /** |
| 85 | 85 | * @method kernel |
@@ -90,12 +90,12 @@ discard block |
||
| 90 | 90 | /** |
| 91 | 91 | * @return array |
| 92 | 92 | */ |
| 93 | - public function kernelGroupKeys(); |
|
| 93 | + public function kernelGroupKeys(); |
|
| 94 | 94 | |
| 95 | 95 | /** |
| 96 | 96 | * @return array |
| 97 | 97 | */ |
| 98 | - public function kernelGroupList(); |
|
| 98 | + public function kernelGroupList(); |
|
| 99 | 99 | |
| 100 | 100 | /** |
| 101 | 101 | * @param callable $callback |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | * @param string $path |
| 161 | 161 | * @return mixed |
| 162 | 162 | */ |
| 163 | - public function setPaths($name,$path); |
|
| 163 | + public function setPaths($name,$path); |
|
| 164 | 164 | |
| 165 | 165 | /** |
| 166 | 166 | * @param null $object |
@@ -178,5 +178,5 @@ discard block |
||
| 178 | 178 | /** |
| 179 | 179 | * @return mixed |
| 180 | 180 | */ |
| 181 | - public function version(); |
|
| 181 | + public function version(); |
|
| 182 | 182 | } |
| 183 | 183 | \ No newline at end of file |
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | * @param null|string $alias |
| 12 | 12 | * @return mixed |
| 13 | 13 | */ |
| 14 | - public function bind($object=null,$callback=null,$alias=null); |
|
| 14 | + public function bind($object = null, $callback = null, $alias = null); |
|
| 15 | 15 | |
| 16 | 16 | /** |
| 17 | 17 | * @param $object |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | * @param array $arguments |
| 25 | 25 | * @return mixed |
| 26 | 26 | */ |
| 27 | - public function command($command,$arguments=array()); |
|
| 27 | + public function command($command, $arguments = array()); |
|
| 28 | 28 | |
| 29 | 29 | /** |
| 30 | 30 | * @return array |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | * @param array $environment |
| 52 | 52 | * @return mixed |
| 53 | 53 | */ |
| 54 | - public function environment($environment=array()); |
|
| 54 | + public function environment($environment = array()); |
|
| 55 | 55 | |
| 56 | 56 | /** |
| 57 | 57 | * @param $abstract |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | * @param $instance |
| 76 | 76 | * @return mixed |
| 77 | 77 | */ |
| 78 | - public function instance ($abstract,$instance); |
|
| 78 | + public function instance($abstract, $instance); |
|
| 79 | 79 | |
| 80 | 80 | /** |
| 81 | 81 | * @return mixed |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | * @param array $loaders |
| 109 | 109 | * @return mixed |
| 110 | 110 | */ |
| 111 | - public function loadIfNotExistBoot($loaders=array()); |
|
| 111 | + public function loadIfNotExistBoot($loaders = array()); |
|
| 112 | 112 | |
| 113 | 113 | /** |
| 114 | 114 | * @method bind |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | * @param $container false |
| 118 | 118 | * @return mixed |
| 119 | 119 | */ |
| 120 | - public function make($object=null,$callback=null,$container=false); |
|
| 120 | + public function make($object = null, $callback = null, $container = false); |
|
| 121 | 121 | |
| 122 | 122 | /** |
| 123 | 123 | * @param $maker |
@@ -141,14 +141,14 @@ discard block |
||
| 141 | 141 | * @param mixed $concrete |
| 142 | 142 | * @return mixed |
| 143 | 143 | */ |
| 144 | - public function register($key,$object,$concrete=null); |
|
| 144 | + public function register($key, $object, $concrete = null); |
|
| 145 | 145 | |
| 146 | 146 | /** |
| 147 | 147 | * @param $class |
| 148 | 148 | * @param array $bind |
| 149 | 149 | * @return mixed |
| 150 | 150 | */ |
| 151 | - public function resolve($class,$bind=array()); |
|
| 151 | + public function resolve($class, $bind = array()); |
|
| 152 | 152 | |
| 153 | 153 | /** |
| 154 | 154 | * @param $class |
@@ -171,14 +171,14 @@ discard block |
||
| 171 | 171 | * @param string $path |
| 172 | 172 | * @return mixed |
| 173 | 173 | */ |
| 174 | - public function setPaths($name,$path); |
|
| 174 | + public function setPaths($name, $path); |
|
| 175 | 175 | |
| 176 | 176 | /** |
| 177 | 177 | * @param null $object |
| 178 | 178 | * @param null $callback |
| 179 | 179 | * @return mixed |
| 180 | 180 | */ |
| 181 | - public function share($object=null,$callback=null); |
|
| 181 | + public function share($object = null, $callback = null); |
|
| 182 | 182 | |
| 183 | 183 | /** |
| 184 | 184 | * @method singleton |
@@ -191,7 +191,7 @@ discard block |
||
| 191 | 191 | * @param null|string $object |
| 192 | 192 | * @return mixed |
| 193 | 193 | */ |
| 194 | - public function terminate($key,$object=null); |
|
| 194 | + public function terminate($key, $object = null); |
|
| 195 | 195 | |
| 196 | 196 | /** |
| 197 | 197 | * @return mixed |
@@ -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; |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | {
|
| 31 | 31 | // Use default autoload implementation |
| 32 | 32 | // Register given function as __autoload() implementation |
| 33 | - spl_autoload_register(function($class){
|
|
| 33 | + spl_autoload_register(function($class) {
|
|
| 34 | 34 | $this->getRegisterCallBackVar($class); |
| 35 | 35 | $this->registerCallBackFormatter(); |
| 36 | 36 | }); |
@@ -44,11 +44,11 @@ discard block |
||
| 44 | 44 | */ |
| 45 | 45 | private function getRegisterCallBackVar($class) :void |
| 46 | 46 | {
|
| 47 | - if(defined('root')){
|
|
| 47 | + if (defined('root')) {
|
|
| 48 | 48 | |
| 49 | 49 | $this->class = $class; |
| 50 | 50 | $this->classPath = root.''.DIRECTORY_SEPARATOR.''.$this->class.''.self::FileExtension; |
| 51 | - $this->classPath = str_replace("\\","/",$this->classPath);
|
|
| 51 | + $this->classPath = str_replace("\\", "/", $this->classPath);
|
|
| 52 | 52 | } |
| 53 | 53 | } |
| 54 | 54 | |
@@ -57,9 +57,9 @@ discard block |
||
| 57 | 57 | * |
| 58 | 58 | * return mixed |
| 59 | 59 | */ |
| 60 | - private function registerCallBackFormatter () |
|
| 60 | + private function registerCallBackFormatter() |
|
| 61 | 61 | {
|
| 62 | - $this->checkAliasClassFormatter($this->classPath,function() {
|
|
| 62 | + $this->checkAliasClassFormatter($this->classPath, function() {
|
|
| 63 | 63 | require($this->classPath); |
| 64 | 64 | }); |
| 65 | 65 | } |
@@ -71,16 +71,16 @@ discard block |
||
| 71 | 71 | * @param $callback |
| 72 | 72 | * @return mixed |
| 73 | 73 | */ |
| 74 | - private function checkAliasClassFormatter($class,$callback) |
|
| 74 | + private function checkAliasClassFormatter($class, $callback) |
|
| 75 | 75 | {
|
| 76 | 76 | $systemApp = []; |
| 77 | 77 | |
| 78 | - if(defined('app')){
|
|
| 78 | + if (defined('app')) {
|
|
| 79 | 79 | $systemApp = (new ClassAliasGroup())->handle(); |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | - if(!file_exists($class)){
|
|
| 83 | - $this->getAliasClassFormatter($class,$systemApp); |
|
| 82 | + if (!file_exists($class)) {
|
|
| 83 | + $this->getAliasClassFormatter($class, $systemApp); |
|
| 84 | 84 | return false; |
| 85 | 85 | } |
| 86 | 86 | |
@@ -93,9 +93,9 @@ discard block |
||
| 93 | 93 | * @param $class |
| 94 | 94 | * @param $systemApp |
| 95 | 95 | */ |
| 96 | - private function getAliasClassFormatter($class,$systemApp) |
|
| 96 | + private function getAliasClassFormatter($class, $systemApp) |
|
| 97 | 97 | {
|
| 98 | - $this->setAliasClassGroup($class,$systemApp); |
|
| 98 | + $this->setAliasClassGroup($class, $systemApp); |
|
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | /** |
@@ -104,14 +104,14 @@ discard block |
||
| 104 | 104 | * @param $class |
| 105 | 105 | * @param $systemApp |
| 106 | 106 | */ |
| 107 | - private function setAliasClassGroup($class,$systemApp) |
|
| 107 | + private function setAliasClassGroup($class, $systemApp) |
|
| 108 | 108 | {
|
| 109 | - $alias = str_replace(root.''.DIRECTORY_SEPARATOR.'','',$class); |
|
| 110 | - $alias = str_replace(self::FileExtension,'',$alias); |
|
| 109 | + $alias = str_replace(root.''.DIRECTORY_SEPARATOR.'', '', $class); |
|
| 110 | + $alias = str_replace(self::FileExtension, '', $alias); |
|
| 111 | 111 | |
| 112 | 112 | //set class_alias groups |
| 113 | - if(array_key_exists($alias,$systemApp)){
|
|
| 114 | - class_alias($systemApp[$alias],$alias); |
|
| 113 | + if (array_key_exists($alias, $systemApp)) {
|
|
| 114 | + class_alias($systemApp[$alias], $alias); |
|
| 115 | 115 | } |
| 116 | 116 | } |
| 117 | 117 | } |
@@ -247,8 +247,7 @@ |
||
| 247 | 247 | tap($this['config'],function(ConfigProviderContracts $config) use($callback) {
|
| 248 | 248 | $config->setConfig(call_user_func($callback)); |
| 249 | 249 | }); |
| 250 | - } |
|
| 251 | - else{
|
|
| 250 | + } else{
|
|
| 252 | 251 | //set config instance exception for application |
| 253 | 252 | exception()->unexpectedValue('config instance is not loaded for application container');
|
| 254 | 253 | } |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | * |
| 40 | 40 | * @param bool $console |
| 41 | 41 | */ |
| 42 | - public function __construct($console=false) |
|
| 42 | + public function __construct($console = false) |
|
| 43 | 43 | {
|
| 44 | 44 | //get console status for cli |
| 45 | 45 | $this->console = (is_bool($console)) ? $console : true; |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | {
|
| 60 | 60 | // the booted objects are saved to the kernel. |
| 61 | 61 | // this method checks whether these objects are registered. |
| 62 | - return (isset($this['bindings'],$this['bindings'][$object])); |
|
| 62 | + return (isset($this['bindings'], $this['bindings'][$object])); |
|
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | /** |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | // taking care of the differences between operating system |
| 76 | 76 | // and escaping arguments to prevent security issues. |
| 77 | 77 | // It replaces PHP functions like exec, passthru, shell_exec and system |
| 78 | - return $this->resolve(Command::class,['command'=>$command,'args'=>$arguments])->handle(); |
|
| 78 | + return $this->resolve(Command::class, ['command'=>$command, 'args'=>$arguments])->handle(); |
|
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | /** |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | */ |
| 101 | 101 | public function config($config) |
| 102 | 102 | {
|
| 103 | - if($this->checkBindings(__FUNCTION__)){
|
|
| 103 | + if ($this->checkBindings(__FUNCTION__)) {
|
|
| 104 | 104 | |
| 105 | 105 | /** @var Macro $macro */ |
| 106 | 106 | $macro = $this['macro']; |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | // this includes the configuration macro class. |
| 109 | 109 | // therefore, you can expand your configuration settings from |
| 110 | 110 | // the application kernel identifier to the desired class. |
| 111 | - return $macro->withStatic(Config::macro(),function() use($config){
|
|
| 111 | + return $macro->withStatic(Config::macro(), function() use($config){
|
|
| 112 | 112 | return Config::make($config); |
| 113 | 113 | })->get(); |
| 114 | 114 | |
@@ -151,9 +151,9 @@ discard block |
||
| 151 | 151 | * @param array $environment |
| 152 | 152 | * @return mixed|string |
| 153 | 153 | */ |
| 154 | - public function environment($environment=array()) |
|
| 154 | + public function environment($environment = array()) |
|
| 155 | 155 | {
|
| 156 | - if($this->checkBindings(__FUNCTION__)){
|
|
| 156 | + if ($this->checkBindings(__FUNCTION__)) {
|
|
| 157 | 157 | |
| 158 | 158 | $arguments = (isset(func_get_args()[0])) |
| 159 | 159 | ? func_get_args()[0] : func_get_args(); |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | $environmentContainer = $this['environment']; |
| 163 | 163 | |
| 164 | 164 | return $environmentContainer->environment( |
| 165 | - $arguments,$this['environmentVariables'] |
|
| 165 | + $arguments, $this['environmentVariables'] |
|
| 166 | 166 | ); |
| 167 | 167 | } |
| 168 | 168 | |
@@ -194,7 +194,7 @@ discard block |
||
| 194 | 194 | public function isLocale() : bool |
| 195 | 195 | {
|
| 196 | 196 | //check environment for local |
| 197 | - return $this->environment() === 'local'; |
|
| 197 | + return $this->environment()==='local'; |
|
| 198 | 198 | } |
| 199 | 199 | |
| 200 | 200 | /** |
@@ -208,14 +208,14 @@ discard block |
||
| 208 | 208 | |
| 209 | 209 | // with the help of reflection instance, |
| 210 | 210 | // we get the kernel properties extended with the application object. |
| 211 | - foreach ($this['reflection']($this)->getProperties() as $property){
|
|
| 211 | + foreach ($this['reflection']($this)->getProperties() as $property) {
|
|
| 212 | 212 | $properties[] = $property->getName(); |
| 213 | 213 | } |
| 214 | 214 | |
| 215 | 215 | // we get the names of |
| 216 | 216 | // the kernel properties ended with groups through the Collection class. |
| 217 | - [$groups] = Collection::make($properties)->partition(function($properties){
|
|
| 218 | - return Str::endsWith($properties,'Groups'); |
|
| 217 | + [$groups] = Collection::make($properties)->partition(function($properties) {
|
|
| 218 | + return Str::endsWith($properties, 'Groups'); |
|
| 219 | 219 | }); |
| 220 | 220 | |
| 221 | 221 | //as a result, kernel groups are being returned. |
@@ -232,8 +232,8 @@ discard block |
||
| 232 | 232 | $list = []; |
| 233 | 233 | |
| 234 | 234 | //get kernel group names with manifest method |
| 235 | - foreach ($this->kernelGroupKeys() as $groupKey){
|
|
| 236 | - $list = array_merge($list,$this->manifest($groupKey)); |
|
| 235 | + foreach ($this->kernelGroupKeys() as $groupKey) {
|
|
| 236 | + $list = array_merge($list, $this->manifest($groupKey)); |
|
| 237 | 237 | } |
| 238 | 238 | |
| 239 | 239 | return $list; |
@@ -249,14 +249,14 @@ discard block |
||
| 249 | 249 | {
|
| 250 | 250 | // it adds the values in path data specified |
| 251 | 251 | // by callback to the configuration values. |
| 252 | - if($this['config'] instanceof ConfigProviderContracts){
|
|
| 252 | + if ($this['config'] instanceof ConfigProviderContracts) {
|
|
| 253 | 253 | |
| 254 | 254 | //set your path for config loader |
| 255 | - tap($this['config'],function(ConfigProviderContracts $config) use($callback) {
|
|
| 255 | + tap($this['config'], function(ConfigProviderContracts $config) use($callback) {
|
|
| 256 | 256 | $config->setConfig(call_user_func($callback)); |
| 257 | 257 | }); |
| 258 | 258 | } |
| 259 | - else{
|
|
| 259 | + else {
|
|
| 260 | 260 | //set config instance exception for application |
| 261 | 261 | exception()->unexpectedValue('config instance is not loaded for application container');
|
| 262 | 262 | } |
@@ -268,7 +268,7 @@ discard block |
||
| 268 | 268 | * @param array $loaders |
| 269 | 269 | * @return mixed|void |
| 270 | 270 | */ |
| 271 | - public function loadIfNotExistBoot($loaders=array()) |
|
| 271 | + public function loadIfNotExistBoot($loaders = array()) |
|
| 272 | 272 | {
|
| 273 | 273 | //get kernel group list from application |
| 274 | 274 | $kernelGroupList = $this->kernelGroupList(); |
@@ -276,14 +276,14 @@ discard block |
||
| 276 | 276 | /** @var ClosureDispatcherContracts $closureBootLoader */ |
| 277 | 277 | $closureBootLoader = $this['closureBootLoader']; |
| 278 | 278 | |
| 279 | - foreach ($loaders as $loader){
|
|
| 279 | + foreach ($loaders as $loader) {
|
|
| 280 | 280 | |
| 281 | 281 | // if a service needs another boot service, |
| 282 | 282 | // the service is directly installed here and the service needs are resolved. |
| 283 | - if(isset($kernelGroupList[$loader]) && $this->checkBindings($loader)===false){
|
|
| 283 | + if (isset($kernelGroupList[$loader]) && $this->checkBindings($loader)===false) {
|
|
| 284 | 284 | |
| 285 | 285 | //with the boot loader kernel,we get the boot loader method. |
| 286 | - $closureBootLoader->call(function() use($loader,$kernelGroupList) {
|
|
| 286 | + $closureBootLoader->call(function() use($loader, $kernelGroupList) {
|
|
| 287 | 287 | |
| 288 | 288 | /** @var BootLoader $bootLoader */ |
| 289 | 289 | $bootLoader = $this; |
@@ -306,7 +306,7 @@ discard block |
||
| 306 | 306 | $bootstrapper = $this['bootstrapper']; |
| 307 | 307 | |
| 308 | 308 | //kernel manifest bootstrapper |
| 309 | - return $bootstrapper->bootFire(null,$maker); |
|
| 309 | + return $bootstrapper->bootFire(null, $maker); |
|
| 310 | 310 | } |
| 311 | 311 | |
| 312 | 312 | /** |
@@ -317,7 +317,7 @@ discard block |
||
| 317 | 317 | public function runningInConsole() : bool |
| 318 | 318 | {
|
| 319 | 319 | //Determine if the application is running in the console. |
| 320 | - return php_sapi_name() === 'cli' || php_sapi_name() === 'phpdbg'; |
|
| 320 | + return php_sapi_name()==='cli' || php_sapi_name()==='phpdbg'; |
|
| 321 | 321 | } |
| 322 | 322 | |
| 323 | 323 | /** |
@@ -333,7 +333,7 @@ discard block |
||
| 333 | 333 | : []; |
| 334 | 334 | |
| 335 | 335 | //core kernel providers and project providers have been merged |
| 336 | - return array_merge($this->manifest('providers'),$providers);
|
|
| 336 | + return array_merge($this->manifest('providers'), $providers);
|
|
| 337 | 337 | } |
| 338 | 338 | |
| 339 | 339 | /** |
@@ -343,12 +343,12 @@ discard block |
||
| 343 | 343 | * @param string $path |
| 344 | 344 | * @return mixed|void |
| 345 | 345 | */ |
| 346 | - public function setPaths($name,$path) |
|
| 346 | + public function setPaths($name, $path) |
|
| 347 | 347 | {
|
| 348 | 348 | // save the globally identified paths to |
| 349 | 349 | // the global container object of the resta. |
| 350 | - if(file_exists($path)){
|
|
| 351 | - $this->register('paths',$name,$path);
|
|
| 350 | + if (file_exists($path)) {
|
|
| 351 | + $this->register('paths', $name, $path);
|
|
| 352 | 352 | } |
| 353 | 353 | } |
| 354 | 354 | |