@@ -10,9 +10,9 @@ discard block |
||
| 10 | 10 | /** |
| 11 | 11 | * @param array $data |
| 12 | 12 | */ |
| 13 | - public function exception($data=array()) |
|
| 13 | + public function exception($data = array()) |
|
| 14 | 14 | {
|
| 15 | - if(!isset($data['project']) and !isset($data['version'])){
|
|
| 15 | + if (!isset($data['project']) and !isset($data['version'])) {
|
|
| 16 | 16 | exception()->notFoundException('No Project or Version');
|
| 17 | 17 | } |
| 18 | 18 | |
@@ -21,17 +21,17 @@ discard block |
||
| 21 | 21 | |
| 22 | 22 | //If there is no project on the url |
| 23 | 23 | //we throw an exception |
| 24 | - if($data['project']===null OR !file_exists($appPath)){
|
|
| 24 | + if ($data['project']===null OR !file_exists($appPath)) {
|
|
| 25 | 25 | exception()->notFoundException('No Project');
|
| 26 | 26 | } |
| 27 | 27 | |
| 28 | - if(!in_array($data['version'],UrlVersionIdentifier::supportedVersions())){
|
|
| 28 | + if (!in_array($data['version'], UrlVersionIdentifier::supportedVersions())) {
|
|
| 29 | 29 | throw new DomainException('Version Number is not supported');
|
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | //If there is no endpoint on the url |
| 33 | 33 | //we throw an exception |
| 34 | - if($data['endpoint']===null){
|
|
| 34 | + if ($data['endpoint']===null) {
|
|
| 35 | 35 | exception()->notFoundException('No Endpoint');
|
| 36 | 36 | } |
| 37 | 37 | } |
@@ -99,8 +99,7 @@ discard block |
||
| 99 | 99 | // in the application directory class. |
| 100 | 100 | if(Utils::isNamespaceExists($nameNamespace)){
|
| 101 | 101 | $callNamespace = new $nameNamespace; |
| 102 | - } |
|
| 103 | - else{
|
|
| 102 | + } else{
|
|
| 104 | 103 | |
| 105 | 104 | // if you do not have an exception in the application directory, |
| 106 | 105 | // this time we are looking for an exception in the core directory. |
@@ -133,8 +132,7 @@ discard block |
||
| 133 | 132 | //throw exception |
| 134 | 133 | if($msg===null){
|
| 135 | 134 | throw new $callNamespace; |
| 136 | - } |
|
| 137 | - else{
|
|
| 135 | + } else{
|
|
| 138 | 136 | throw new $callNamespace($msg); |
| 139 | 137 | } |
| 140 | 138 | |
@@ -16,13 +16,13 @@ discard block |
||
| 16 | 16 | * @param null|string $name |
| 17 | 17 | * @param array $params |
| 18 | 18 | */ |
| 19 | - public function __construct($app,$name=null,$params=array()) |
|
| 19 | + public function __construct($app, $name = null, $params = array()) |
|
| 20 | 20 | {
|
| 21 | 21 | parent::__construct($app); |
| 22 | 22 | |
| 23 | 23 | // we help the user to pull a special message from |
| 24 | 24 | // the translate section to be specified by the user for the exception. |
| 25 | - $this->exceptionTranslate($name,$params); |
|
| 25 | + $this->exceptionTranslate($name, $params); |
|
| 26 | 26 | |
| 27 | 27 | // for real file path with |
| 28 | 28 | // debug backtrace method are doing follow. |
@@ -35,13 +35,13 @@ discard block |
||
| 35 | 35 | * @param $name |
| 36 | 36 | * @param array $params |
| 37 | 37 | */ |
| 38 | - private function exceptionTranslate($name,$params=array()) |
|
| 38 | + private function exceptionTranslate($name, $params = array()) |
|
| 39 | 39 | {
|
| 40 | - if($name!==null){
|
|
| 41 | - if(count($params)){
|
|
| 42 | - $this->app->register('exceptionTranslateParams',$name,$params);
|
|
| 40 | + if ($name!==null) {
|
|
| 41 | + if (count($params)) {
|
|
| 42 | + $this->app->register('exceptionTranslateParams', $name, $params);
|
|
| 43 | 43 | } |
| 44 | - $this->app->register('exceptionTranslate',$name);
|
|
| 44 | + $this->app->register('exceptionTranslate', $name);
|
|
| 45 | 45 | } |
| 46 | 46 | } |
| 47 | 47 | |
@@ -52,23 +52,23 @@ discard block |
||
| 52 | 52 | */ |
| 53 | 53 | public function debugBackTrace() |
| 54 | 54 | {
|
| 55 | - foreach (debug_backtrace() as $key=>$value){
|
|
| 55 | + foreach (debug_backtrace() as $key=>$value) {
|
|
| 56 | 56 | |
| 57 | - if(isset(debug_backtrace()[$key],debug_backtrace()[$key]['file'])) |
|
| 57 | + if (isset(debug_backtrace()[$key], debug_backtrace()[$key]['file'])) |
|
| 58 | 58 | {
|
| 59 | - $this->app->register('exceptionFile',debug_backtrace()[$key]['file']);
|
|
| 60 | - $this->app->register('exceptionLine',debug_backtrace()[$key]['line']);
|
|
| 59 | + $this->app->register('exceptionFile', debug_backtrace()[$key]['file']);
|
|
| 60 | + $this->app->register('exceptionLine', debug_backtrace()[$key]['line']);
|
|
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | Dependencies::loadBootstrapperNeedsForException(); |
| 64 | 64 | |
| 65 | - if(isset($value['file']) && isset(core()->urlComponent)){
|
|
| 66 | - if(preg_match('@'.core()->urlComponent['project'].'|boot|providers@',$value['file'])){
|
|
| 65 | + if (isset($value['file']) && isset(core()->urlComponent)) {
|
|
| 66 | + if (preg_match('@'.core()->urlComponent['project'].'|boot|providers@', $value['file'])) {
|
|
| 67 | 67 | |
| 68 | 68 | $this->app->terminate('exceptionFile');
|
| 69 | 69 | $this->app->terminate('exceptionLine');
|
| 70 | - $this->app->register('exceptionFile',$value['file']);
|
|
| 71 | - $this->app->register('exceptionLine',$value['line']);
|
|
| 70 | + $this->app->register('exceptionFile', $value['file']);
|
|
| 71 | + $this->app->register('exceptionLine', $value['line']);
|
|
| 72 | 72 | |
| 73 | 73 | break; |
| 74 | 74 | } |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | */ |
| 82 | 82 | public function __get($name) |
| 83 | 83 | {
|
| 84 | - $this->customException($name,null,debug_backtrace()); |
|
| 84 | + $this->customException($name, null, debug_backtrace()); |
|
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | /** |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | * @param null|string $msg |
| 92 | 92 | * @param array $trace |
| 93 | 93 | */ |
| 94 | - public function customException($name,$msg=null,$trace=array()) |
|
| 94 | + public function customException($name, $msg = null, $trace = array()) |
|
| 95 | 95 | {
|
| 96 | 96 | //We use the magic method for the exception and |
| 97 | 97 | //call the exception class in the application to get the instance. |
@@ -100,22 +100,22 @@ discard block |
||
| 100 | 100 | |
| 101 | 101 | // first, you are looking for an exception |
| 102 | 102 | // in the application directory class. |
| 103 | - if(Utils::isNamespaceExists($nameNamespace)){
|
|
| 103 | + if (Utils::isNamespaceExists($nameNamespace)) {
|
|
| 104 | 104 | $callNamespace = new $nameNamespace; |
| 105 | 105 | } |
| 106 | - else{
|
|
| 106 | + else {
|
|
| 107 | 107 | |
| 108 | 108 | // if you do not have an exception in the application directory, |
| 109 | 109 | // this time we are looking for an exception in the core directory. |
| 110 | 110 | $nameNamespace = __NAMESPACE__.'\\'.$nameException; |
| 111 | - if(Utils::isNamespaceExists($nameNamespace)){
|
|
| 111 | + if (Utils::isNamespaceExists($nameNamespace)) {
|
|
| 112 | 112 | $callNamespace = new $nameNamespace; |
| 113 | 113 | } |
| 114 | 114 | } |
| 115 | 115 | |
| 116 | - if(isset($callNamespace)){
|
|
| 116 | + if (isset($callNamespace)) {
|
|
| 117 | 117 | |
| 118 | - $traceForCustom = Utils::removeTrace($trace,self::removeExceptionFileItems); |
|
| 118 | + $traceForCustom = Utils::removeTrace($trace, self::removeExceptionFileItems); |
|
| 119 | 119 | |
| 120 | 120 | // we will set the information about the exception trace, |
| 121 | 121 | // and then bind it specifically to the event method. |
@@ -127,19 +127,19 @@ discard block |
||
| 127 | 127 | |
| 128 | 128 | |
| 129 | 129 | // we register the custom exception trace value with the global kernel object. |
| 130 | - $this->app->register('exceptiontrace',$customExceptionTrace);
|
|
| 130 | + $this->app->register('exceptiontrace', $customExceptionTrace);
|
|
| 131 | 131 | |
| 132 | 132 | //If the developer wants to execute an event when calling a special exception, |
| 133 | 133 | //we process the event method. |
| 134 | - if(method_exists($callNamespace,'event')){
|
|
| 134 | + if (method_exists($callNamespace, 'event')) {
|
|
| 135 | 135 | $callNamespace->event($customExceptionTrace); |
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 | //throw exception |
| 139 | - if($msg===null){
|
|
| 139 | + if ($msg===null) {
|
|
| 140 | 140 | throw new $callNamespace; |
| 141 | 141 | } |
| 142 | - else{
|
|
| 142 | + else {
|
|
| 143 | 143 | throw new $callNamespace($msg); |
| 144 | 144 | } |
| 145 | 145 | |
@@ -152,8 +152,8 @@ discard block |
||
| 152 | 152 | * @param $name |
| 153 | 153 | * @param array $arguments |
| 154 | 154 | */ |
| 155 | - public function __call($name, $arguments=array()) |
|
| 155 | + public function __call($name, $arguments = array()) |
|
| 156 | 156 | {
|
| 157 | - $this->customException($name,current($arguments),debug_backtrace()); |
|
| 157 | + $this->customException($name, current($arguments), debug_backtrace()); |
|
| 158 | 158 | } |
| 159 | 159 | } |
| 160 | 160 | \ No newline at end of file |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | public function getArguments() |
| 17 | 17 | {
|
| 18 | 18 | //if there is no arguments constant |
| 19 | - if(!defined('arguments')) define ('arguments',['api']);
|
|
| 19 | + if (!defined('arguments')) define('arguments', ['api']);
|
|
| 20 | 20 | |
| 21 | 21 | //get psr standard console arguments |
| 22 | 22 | return core()->consoleArguments = Utils::upperCase(arguments); |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | */ |
| 50 | 50 | public function getConsoleClassRealArguments() |
| 51 | 51 | {
|
| 52 | - return array_slice($this->getArguments(),2); |
|
| 52 | + return array_slice($this->getArguments(), 2); |
|
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | /** |
@@ -65,19 +65,19 @@ discard block |
||
| 65 | 65 | $listKey = []; |
| 66 | 66 | $listKey['project'] = null; |
| 67 | 67 | |
| 68 | - if(property_exists($this,'consoleClassNamespace')){
|
|
| 68 | + if (property_exists($this, 'consoleClassNamespace')) {
|
|
| 69 | 69 | $listKey['class'] = strtolower(class_basename($this->consoleClassNamespace)); |
| 70 | 70 | $listKey['classMethod'] = strtolower($this->getConsoleClassMethod()); |
| 71 | 71 | } |
| 72 | 72 | |
| 73 | - foreach($getConsoleClassRealArguments as $key=>$value){
|
|
| 73 | + foreach ($getConsoleClassRealArguments as $key=>$value) {
|
|
| 74 | 74 | |
| 75 | - if($key=="0"){
|
|
| 75 | + if ($key=="0") {
|
|
| 76 | 76 | $listKey['project'] = $value; |
| 77 | 77 | } |
| 78 | - else{
|
|
| 78 | + else {
|
|
| 79 | 79 | |
| 80 | - $colonExplode = explode(":",$value);
|
|
| 80 | + $colonExplode = explode(":", $value);
|
|
| 81 | 81 | $listKey[strtolower($colonExplode[0])] = ucfirst($colonExplode[1]); |
| 82 | 82 | } |
| 83 | 83 | } |
@@ -109,14 +109,14 @@ discard block |
||
| 109 | 109 | |
| 110 | 110 | $this->getConsoleArgumentsWithKey(); |
| 111 | 111 | |
| 112 | - if(isset($arguments[2])){
|
|
| 112 | + if (isset($arguments[2])) {
|
|
| 113 | 113 | $app = $arguments[2]; |
| 114 | 114 | } |
| 115 | 115 | |
| 116 | - if(!defined('group')){
|
|
| 117 | - define('group',StaticPathList::$projectPrefixGroup);
|
|
| 116 | + if (!defined('group')) {
|
|
| 117 | + define('group', StaticPathList::$projectPrefixGroup);
|
|
| 118 | 118 | } |
| 119 | 119 | |
| 120 | - if(!defined('app') and isset($arguments[2])) define('app',isset($app) ? $app : null);
|
|
| 120 | + if (!defined('app') and isset($arguments[2])) define('app', isset($app) ? $app : null);
|
|
| 121 | 121 | } |
| 122 | 122 | } |
| 123 | 123 | \ No newline at end of file |
@@ -16,7 +16,9 @@ discard block |
||
| 16 | 16 | public function getArguments() |
| 17 | 17 | {
|
| 18 | 18 | //if there is no arguments constant |
| 19 | - if(!defined('arguments')) define ('arguments',['api']);
|
|
| 19 | + if(!defined('arguments')) {
|
|
| 20 | + define ('arguments',['api']);
|
|
| 21 | + } |
|
| 20 | 22 | |
| 21 | 23 | //get psr standard console arguments |
| 22 | 24 | return core()->consoleArguments = Utils::upperCase(arguments); |
@@ -74,8 +76,7 @@ discard block |
||
| 74 | 76 | |
| 75 | 77 | if($key=="0"){
|
| 76 | 78 | $listKey['project'] = $value; |
| 77 | - } |
|
| 78 | - else{
|
|
| 79 | + } else{
|
|
| 79 | 80 | |
| 80 | 81 | $colonExplode = explode(":",$value);
|
| 81 | 82 | $listKey[strtolower($colonExplode[0])] = ucfirst($colonExplode[1]); |
@@ -117,6 +118,8 @@ discard block |
||
| 117 | 118 | define('group',StaticPathList::$projectPrefixGroup);
|
| 118 | 119 | } |
| 119 | 120 | |
| 120 | - if(!defined('app') and isset($arguments[2])) define('app',isset($app) ? $app : null);
|
|
| 121 | + if(!defined('app') and isset($arguments[2])) {
|
|
| 122 | + define('app',isset($app) ? $app : null);
|
|
| 123 | + } |
|
| 121 | 124 | } |
| 122 | 125 | } |
| 123 | 126 | \ No newline at end of file |
@@ -14,6 +14,6 @@ |
||
| 14 | 14 | * @param array $commander |
| 15 | 15 | * @return mixed |
| 16 | 16 | */ |
| 17 | - public function exception($commander=array()); |
|
| 17 | + public function exception($commander = array()); |
|
| 18 | 18 | |
| 19 | 19 | } |
| 20 | 20 | \ No newline at end of file |
@@ -72,8 +72,7 @@ discard block |
||
| 72 | 72 | {
|
| 73 | 73 | if($extension){
|
| 74 | 74 | $default=root.'/'.str_replace("\\","/",$class).'.php';
|
| 75 | - } |
|
| 76 | - else{
|
|
| 75 | + } else{
|
|
| 77 | 76 | $default=root.'/'.str_replace("\\","/",$class).'';
|
| 78 | 77 | } |
| 79 | 78 | |
@@ -240,21 +239,32 @@ discard block |
||
| 240 | 239 | */ |
| 241 | 240 | public static function array_diff_key_recursive ($array1, $array2) |
| 242 | 241 | {
|
| 243 | - if(count($array1)!==count($array2)) self::$bool[]=false; |
|
| 242 | + if(count($array1)!==count($array2)) {
|
|
| 243 | + self::$bool[]=false; |
|
| 244 | + } |
|
| 244 | 245 | |
| 245 | 246 | foreach ($array1 as $array1_key=>$array1_value){
|
| 246 | 247 | |
| 247 | 248 | if(!is_array($array1_value)){
|
| 248 | - if(!array_key_exists($array1_key,$array2)) self::$bool[]=false; |
|
| 249 | - } |
|
| 250 | - else{
|
|
| 251 | - if(!array_key_exists($array1_key,$array2)) self::$bool[]=false; |
|
| 249 | + if(!array_key_exists($array1_key,$array2)) {
|
|
| 250 | + self::$bool[]=false; |
|
| 251 | + } |
|
| 252 | + } else{
|
|
| 253 | + if(!array_key_exists($array1_key,$array2)) {
|
|
| 254 | + self::$bool[]=false; |
|
| 255 | + } |
|
| 252 | 256 | |
| 253 | - if(!isset($array2[$array1_key]) OR !is_array($array2[$array1_key])) $array2[$array1_key]=[]; |
|
| 257 | + if(!isset($array2[$array1_key]) OR !is_array($array2[$array1_key])) {
|
|
| 258 | + $array2[$array1_key]=[]; |
|
| 259 | + } |
|
| 254 | 260 | |
| 255 | - if(isset($array1_value[0])) $array1_value=$array1_value[0]; |
|
| 261 | + if(isset($array1_value[0])) {
|
|
| 262 | + $array1_value=$array1_value[0]; |
|
| 263 | + } |
|
| 256 | 264 | |
| 257 | - if(isset($array2[$array1_key][0])) $array2[$array1_key]=$array2[$array1_key][0]; |
|
| 265 | + if(isset($array2[$array1_key][0])) {
|
|
| 266 | + $array2[$array1_key]=$array2[$array1_key][0]; |
|
| 267 | + } |
|
| 258 | 268 | |
| 259 | 269 | self::array_diff_key_recursive($array1_value,$array2[$array1_key]); |
| 260 | 270 | } |
@@ -356,8 +366,7 @@ discard block |
||
| 356 | 366 | |
| 357 | 367 | if($reelPath===null){
|
| 358 | 368 | $pathWithPhpList[] = $pathWithPhp[0]; |
| 359 | - } |
|
| 360 | - else{
|
|
| 369 | + } else{
|
|
| 361 | 370 | $pathWithPhpList[] = $reelPath.'/'.$pathWithPhp[0]; |
| 362 | 371 | } |
| 363 | 372 | |
@@ -16,13 +16,13 @@ discard block |
||
| 16 | 16 | * @param bool $shift |
| 17 | 17 | * @return array |
| 18 | 18 | */ |
| 19 | - public static function upperCase($argument,$shift=true) |
|
| 19 | + public static function upperCase($argument, $shift = true) |
|
| 20 | 20 | {
|
| 21 | - if($shift){
|
|
| 21 | + if ($shift) {
|
|
| 22 | 22 | array_shift($argument); |
| 23 | 23 | } |
| 24 | 24 | |
| 25 | - return array_map(function($argument){
|
|
| 25 | + return array_map(function($argument) {
|
|
| 26 | 26 | return ucfirst($argument); |
| 27 | 27 | },$argument); |
| 28 | 28 | } |
@@ -46,10 +46,10 @@ discard block |
||
| 46 | 46 | */ |
| 47 | 47 | public static function strtolower($argument) |
| 48 | 48 | {
|
| 49 | - if(!is_array($argument)){
|
|
| 49 | + if (!is_array($argument)) {
|
|
| 50 | 50 | return strtolower($argument); |
| 51 | 51 | } |
| 52 | - return array_map(function($argument){
|
|
| 52 | + return array_map(function($argument) {
|
|
| 53 | 53 | return strtolower($argument); |
| 54 | 54 | },$argument); |
| 55 | 55 | } |
@@ -58,9 +58,9 @@ discard block |
||
| 58 | 58 | * @param array $data |
| 59 | 59 | * @return string |
| 60 | 60 | */ |
| 61 | - public static function generatorNamespace($data=array()) |
|
| 61 | + public static function generatorNamespace($data = array()) |
|
| 62 | 62 | {
|
| 63 | - return str_replace('.php','',implode("\\",$data));
|
|
| 63 | + return str_replace('.php', '', implode("\\", $data));
|
|
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | /** |
@@ -68,16 +68,16 @@ discard block |
||
| 68 | 68 | * @param bool $extension |
| 69 | 69 | * @return mixed |
| 70 | 70 | */ |
| 71 | - public static function getPathFromNamespace($class,$extension=true) |
|
| 71 | + public static function getPathFromNamespace($class, $extension = true) |
|
| 72 | 72 | {
|
| 73 | - if($extension){
|
|
| 74 | - $default=root.'/'.str_replace("\\","/",$class).'.php';
|
|
| 73 | + if ($extension) {
|
|
| 74 | + $default = root.'/'.str_replace("\\", "/", $class).'.php';
|
|
| 75 | 75 | } |
| 76 | - else{
|
|
| 77 | - $default=root.'/'.str_replace("\\","/",$class).'';
|
|
| 76 | + else {
|
|
| 77 | + $default = root.'/'.str_replace("\\", "/", $class).'';
|
|
| 78 | 78 | } |
| 79 | 79 | |
| 80 | - return str_replace("/App",'/src/app',$default);
|
|
| 80 | + return str_replace("/App", '/src/app', $default);
|
|
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | /** |
@@ -94,9 +94,9 @@ discard block |
||
| 94 | 94 | * @param $method |
| 95 | 95 | * @return bool |
| 96 | 96 | */ |
| 97 | - public static function existMethod($class,$method) |
|
| 97 | + public static function existMethod($class, $method) |
|
| 98 | 98 | {
|
| 99 | - return method_exists($class,$method); |
|
| 99 | + return method_exists($class, $method); |
|
| 100 | 100 | } |
| 101 | 101 | |
| 102 | 102 | /** |
@@ -104,9 +104,9 @@ discard block |
||
| 104 | 104 | * @param $second |
| 105 | 105 | * @return bool |
| 106 | 106 | */ |
| 107 | - public static function isArrayEqual($first,$second) |
|
| 107 | + public static function isArrayEqual($first, $second) |
|
| 108 | 108 | {
|
| 109 | - return (count( $first ) == count( $second ) && !array_diff( $first, $second )); |
|
| 109 | + return (count($first)==count($second) && !array_diff($first, $second)); |
|
| 110 | 110 | } |
| 111 | 111 | |
| 112 | 112 | /** |
@@ -123,17 +123,17 @@ discard block |
||
| 123 | 123 | * @param bool $filename |
| 124 | 124 | * @return array |
| 125 | 125 | */ |
| 126 | - public static function glob($path,$filename=false) |
|
| 126 | + public static function glob($path, $filename = false) |
|
| 127 | 127 | {
|
| 128 | 128 | $configList = []; |
| 129 | 129 | |
| 130 | 130 | foreach (glob($path.'/*.php') as $config) {
|
| 131 | 131 | |
| 132 | - $configArray=str_replace(".php","",explode("/",$config));
|
|
| 133 | - $configList[end($configArray)]=$config; |
|
| 132 | + $configArray = str_replace(".php", "", explode("/", $config));
|
|
| 133 | + $configList[end($configArray)] = $config; |
|
| 134 | 134 | } |
| 135 | 135 | |
| 136 | - if($filename===true){
|
|
| 136 | + if ($filename===true) {
|
|
| 137 | 137 | return array_keys($configList); |
| 138 | 138 | } |
| 139 | 139 | |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | * @param string $seperator |
| 163 | 163 | * @return mixed |
| 164 | 164 | */ |
| 165 | - public static function getJustClassName($namespace,$seperator="\\") |
|
| 165 | + public static function getJustClassName($namespace, $seperator = "\\") |
|
| 166 | 166 | {
|
| 167 | 167 | $path = explode($seperator, $namespace); |
| 168 | 168 | return array_pop($path); |
@@ -173,23 +173,23 @@ discard block |
||
| 173 | 173 | * @param array $param |
| 174 | 174 | * @return bool |
| 175 | 175 | */ |
| 176 | - public static function changeClass($class,$param=array()) |
|
| 176 | + public static function changeClass($class, $param = array()) |
|
| 177 | 177 | {
|
| 178 | - $executionPath=$class; |
|
| 178 | + $executionPath = $class; |
|
| 179 | 179 | $dt = fopen($executionPath, "r"); |
| 180 | 180 | |
| 181 | - if($dt!==false){
|
|
| 181 | + if ($dt!==false) {
|
|
| 182 | 182 | |
| 183 | 183 | $content = fread($dt, filesize($executionPath)); |
| 184 | 184 | fclose($dt); |
| 185 | 185 | |
| 186 | - foreach ($param as $key=>$value){
|
|
| 187 | - $content=str_replace($key,$value,$content); |
|
| 186 | + foreach ($param as $key=>$value) {
|
|
| 187 | + $content = str_replace($key, $value, $content); |
|
| 188 | 188 | } |
| 189 | 189 | |
| 190 | 190 | $forWrite = fopen($executionPath, "w"); |
| 191 | 191 | |
| 192 | - if($forWrite!==false){
|
|
| 192 | + if ($forWrite!==false) {
|
|
| 193 | 193 | fwrite($forWrite, $content); |
| 194 | 194 | fclose($forWrite); |
| 195 | 195 | |
@@ -205,9 +205,9 @@ discard block |
||
| 205 | 205 | * @param $callback |
| 206 | 206 | * @return mixed |
| 207 | 207 | */ |
| 208 | - public static function returnCallback($data,$callback) |
|
| 208 | + public static function returnCallback($data, $callback) |
|
| 209 | 209 | {
|
| 210 | - return call_user_func_array($callback,[$data]); |
|
| 210 | + return call_user_func_array($callback, [$data]); |
|
| 211 | 211 | } |
| 212 | 212 | |
| 213 | 213 | /** |
@@ -216,10 +216,10 @@ discard block |
||
| 216 | 216 | */ |
| 217 | 217 | public static function getNamespace($namespace) |
| 218 | 218 | {
|
| 219 | - $rootDelete=str_replace(root.''.DIRECTORY_SEPARATOR.'src'.DIRECTORY_SEPARATOR.'app'.DIRECTORY_SEPARATOR.'','',$namespace); |
|
| 219 | + $rootDelete = str_replace(root.''.DIRECTORY_SEPARATOR.'src'.DIRECTORY_SEPARATOR.'app'.DIRECTORY_SEPARATOR.'', '', $namespace); |
|
| 220 | 220 | |
| 221 | 221 | return 'App\\'.self::generatorNamespace( |
| 222 | - explode(''.DIRECTORY_SEPARATOR.'',$rootDelete)
|
|
| 222 | + explode(''.DIRECTORY_SEPARATOR.'', $rootDelete)
|
|
| 223 | 223 | ); |
| 224 | 224 | |
| 225 | 225 | } |
@@ -230,7 +230,7 @@ discard block |
||
| 230 | 230 | */ |
| 231 | 231 | public static function callbackProcess($callback) |
| 232 | 232 | {
|
| 233 | - return (is_callable($callback)) ? call_user_func_array($callback,[app()]) : $callback; |
|
| 233 | + return (is_callable($callback)) ? call_user_func_array($callback, [app()]) : $callback; |
|
| 234 | 234 | } |
| 235 | 235 | |
| 236 | 236 | /** |
@@ -238,29 +238,29 @@ discard block |
||
| 238 | 238 | * @param $array2 |
| 239 | 239 | * @return bool |
| 240 | 240 | */ |
| 241 | - public static function array_diff_key_recursive ($array1, $array2) |
|
| 241 | + public static function array_diff_key_recursive($array1, $array2) |
|
| 242 | 242 | {
|
| 243 | - if(count($array1)!==count($array2)) self::$bool[]=false; |
|
| 243 | + if (count($array1)!==count($array2)) self::$bool[] = false; |
|
| 244 | 244 | |
| 245 | - foreach ($array1 as $array1_key=>$array1_value){
|
|
| 245 | + foreach ($array1 as $array1_key=>$array1_value) {
|
|
| 246 | 246 | |
| 247 | - if(!is_array($array1_value)){
|
|
| 248 | - if(!array_key_exists($array1_key,$array2)) self::$bool[]=false; |
|
| 247 | + if (!is_array($array1_value)) {
|
|
| 248 | + if (!array_key_exists($array1_key, $array2)) self::$bool[] = false; |
|
| 249 | 249 | } |
| 250 | - else{
|
|
| 251 | - if(!array_key_exists($array1_key,$array2)) self::$bool[]=false; |
|
| 250 | + else {
|
|
| 251 | + if (!array_key_exists($array1_key, $array2)) self::$bool[] = false; |
|
| 252 | 252 | |
| 253 | - if(!isset($array2[$array1_key]) OR !is_array($array2[$array1_key])) $array2[$array1_key]=[]; |
|
| 253 | + if (!isset($array2[$array1_key]) OR !is_array($array2[$array1_key])) $array2[$array1_key] = []; |
|
| 254 | 254 | |
| 255 | - if(isset($array1_value[0])) $array1_value=$array1_value[0]; |
|
| 255 | + if (isset($array1_value[0])) $array1_value = $array1_value[0]; |
|
| 256 | 256 | |
| 257 | - if(isset($array2[$array1_key][0])) $array2[$array1_key]=$array2[$array1_key][0]; |
|
| 257 | + if (isset($array2[$array1_key][0])) $array2[$array1_key] = $array2[$array1_key][0]; |
|
| 258 | 258 | |
| 259 | - self::array_diff_key_recursive($array1_value,$array2[$array1_key]); |
|
| 259 | + self::array_diff_key_recursive($array1_value, $array2[$array1_key]); |
|
| 260 | 260 | } |
| 261 | 261 | } |
| 262 | 262 | |
| 263 | - if(in_array(false,self::$bool)){
|
|
| 263 | + if (in_array(false, self::$bool)) {
|
|
| 264 | 264 | return false; |
| 265 | 265 | } |
| 266 | 266 | return true; |
@@ -272,7 +272,7 @@ discard block |
||
| 272 | 272 | */ |
| 273 | 273 | public static function slashToBackSlash($data) |
| 274 | 274 | {
|
| 275 | - return str_replace("/","\\",$data);
|
|
| 275 | + return str_replace("/", "\\", $data);
|
|
| 276 | 276 | } |
| 277 | 277 | |
| 278 | 278 | /** |
@@ -282,11 +282,11 @@ discard block |
||
| 282 | 282 | * @param null|string $key |
| 283 | 283 | * @return mixed |
| 284 | 284 | */ |
| 285 | - public static function trace($debug=0,$key=null) |
|
| 285 | + public static function trace($debug = 0, $key = null) |
|
| 286 | 286 | {
|
| 287 | 287 | $trace = debug_backtrace(); |
| 288 | 288 | |
| 289 | - if($key===null){
|
|
| 289 | + if ($key===null) {
|
|
| 290 | 290 | return $trace[$debug] ?? null; |
| 291 | 291 | } |
| 292 | 292 | |
@@ -298,7 +298,7 @@ discard block |
||
| 298 | 298 | */ |
| 299 | 299 | public static function getServiceConf() |
| 300 | 300 | {
|
| 301 | - if(property_exists(core(),'serviceConf') && defined('methodName')){
|
|
| 301 | + if (property_exists(core(), 'serviceConf') && defined('methodName')) {
|
|
| 302 | 302 | return core()->serviceConf; |
| 303 | 303 | } |
| 304 | 304 | return []; |
@@ -309,18 +309,18 @@ discard block |
||
| 309 | 309 | * @param null|string $reelPath |
| 310 | 310 | * @return array |
| 311 | 311 | */ |
| 312 | - public static function getPathWithPhpExtension($files,$reelPath=null) |
|
| 312 | + public static function getPathWithPhpExtension($files, $reelPath = null) |
|
| 313 | 313 | {
|
| 314 | 314 | $pathWithPhpList = []; |
| 315 | 315 | |
| 316 | - foreach ($files as $file){
|
|
| 316 | + foreach ($files as $file) {
|
|
| 317 | 317 | |
| 318 | - if(preg_match('@(.*).php@is',$file,$pathWithPhp)){
|
|
| 318 | + if (preg_match('@(.*).php@is', $file, $pathWithPhp)) {
|
|
| 319 | 319 | |
| 320 | - if($reelPath===null){
|
|
| 320 | + if ($reelPath===null) {
|
|
| 321 | 321 | $pathWithPhpList[] = $pathWithPhp[0]; |
| 322 | 322 | } |
| 323 | - else{
|
|
| 323 | + else {
|
|
| 324 | 324 | $pathWithPhpList[] = $reelPath.'/'.$pathWithPhp[0]; |
| 325 | 325 | } |
| 326 | 326 | |
@@ -336,7 +336,7 @@ discard block |
||
| 336 | 336 | */ |
| 337 | 337 | public static function resolverClass($class) |
| 338 | 338 | {
|
| 339 | - if(self::isNamespaceExists($class)){
|
|
| 339 | + if (self::isNamespaceExists($class)) {
|
|
| 340 | 340 | return app()->resolve($class); |
| 341 | 341 | } |
| 342 | 342 | |
@@ -348,8 +348,8 @@ discard block |
||
| 348 | 348 | */ |
| 349 | 349 | public static function getRequestPathInfo() |
| 350 | 350 | {
|
| 351 | - if(is_null(BootStaticManager::getRequestPath())){
|
|
| 352 | - return explode("/",request()->getPathInfo());
|
|
| 351 | + if (is_null(BootStaticManager::getRequestPath())) {
|
|
| 352 | + return explode("/", request()->getPathInfo());
|
|
| 353 | 353 | } |
| 354 | 354 | return BootStaticManager::getRequestPath(); |
| 355 | 355 | } |
@@ -359,13 +359,13 @@ discard block |
||
| 359 | 359 | * @param null|string $remove |
| 360 | 360 | * @return array |
| 361 | 361 | */ |
| 362 | - public static function removeTrace($trace,$remove=null) |
|
| 362 | + public static function removeTrace($trace, $remove = null) |
|
| 363 | 363 | {
|
| 364 | 364 | $list = []; |
| 365 | 365 | |
| 366 | - foreach($trace as $key=>$item){
|
|
| 366 | + foreach ($trace as $key=>$item) {
|
|
| 367 | 367 | |
| 368 | - if(isset($item['file']) && !preg_match('@'.$remove.'@',$item['file'])){
|
|
| 368 | + if (isset($item['file']) && !preg_match('@'.$remove.'@', $item['file'])) {
|
|
| 369 | 369 | $list[$key] = $item; |
| 370 | 370 | } |
| 371 | 371 | } |
@@ -22,14 +22,14 @@ discard block |
||
| 22 | 22 | * @param ApplicationContracts $app |
| 23 | 23 | * @param array $result |
| 24 | 24 | */ |
| 25 | - public function __construct(ApplicationContracts $app,$result=array()) |
|
| 25 | + public function __construct(ApplicationContracts $app, $result = array()) |
|
| 26 | 26 | { |
| 27 | 27 | parent::__construct($app); |
| 28 | 28 | |
| 29 | 29 | $this->result = $result; |
| 30 | 30 | |
| 31 | - foreach($this->extender as $item){ |
|
| 32 | - if(method_exists($this,$item)){ |
|
| 31 | + foreach ($this->extender as $item) { |
|
| 32 | + if (method_exists($this, $item)) { |
|
| 33 | 33 | $this->{$item}(); |
| 34 | 34 | } |
| 35 | 35 | } |
@@ -54,8 +54,8 @@ discard block |
||
| 54 | 54 | { |
| 55 | 55 | // we will look at the requestExpected container value to show |
| 56 | 56 | // the expected values for the request object in the exception output. |
| 57 | - if($this->app->has('requestExpected') && config('app.requestWithError')===true){ |
|
| 58 | - if($requestExpected = $this->app->get('requestExpected')){ |
|
| 57 | + if ($this->app->has('requestExpected') && config('app.requestWithError')===true) { |
|
| 58 | + if ($requestExpected = $this->app->get('requestExpected')) { |
|
| 59 | 59 | $this->result['request']['expected'] = $requestExpected; |
| 60 | 60 | } |
| 61 | 61 | } |
@@ -25,26 +25,26 @@ |
||
| 25 | 25 | * @param null|string $name |
| 26 | 26 | * @return array |
| 27 | 27 | */ |
| 28 | - public function container($name=null) |
|
| 28 | + public function container($name = null) |
|
| 29 | 29 | {
|
| 30 | 30 | //check container value for kernel |
| 31 | - if(isset($this->instances['container'])){
|
|
| 31 | + if (isset($this->instances['container'])) {
|
|
| 32 | 32 | |
| 33 | 33 | // if methoda is a null parameter, |
| 34 | 34 | // then we send direct container values. |
| 35 | - if(is_null($name)){
|
|
| 35 | + if (is_null($name)) {
|
|
| 36 | 36 | return (array)$this->instances['container']; |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | // if there is an existing value in the container as the method parameter, |
| 40 | 40 | // we send this value directly in the container. |
| 41 | - if(isset($this->container()[$name])){
|
|
| 41 | + if (isset($this->container()[$name])) {
|
|
| 42 | 42 | return $this->container()[$name]; |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | // if there is no $name value in the container as the method parameter, |
| 46 | 46 | // we check this value directly in the core object. |
| 47 | - if(property_exists(core(),$name)){
|
|
| 47 | + if (property_exists(core(), $name)) {
|
|
| 48 | 48 | return core()->{$name};
|
| 49 | 49 | } |
| 50 | 50 | |
@@ -32,15 +32,15 @@ discard block |
||
| 32 | 32 | * @param callable $callback |
| 33 | 33 | * @return mixed|null |
| 34 | 34 | */ |
| 35 | - public function call($macro,callable $callback) |
|
| 35 | + public function call($macro, callable $callback) |
|
| 36 | 36 | {
|
| 37 | - if(!is_null($macro)){
|
|
| 37 | + if (!is_null($macro)) {
|
|
| 38 | 38 | |
| 39 | 39 | //get macro class from kernel macros |
| 40 | 40 | $macroCall = config('kernel.macros.'.$macro);
|
| 41 | 41 | |
| 42 | 42 | //if macroCall class is available and an object. |
| 43 | - if(!is_null($macroCall) && Utils::isNamespaceExists($macroCall)){
|
|
| 43 | + if (!is_null($macroCall) && Utils::isNamespaceExists($macroCall)) {
|
|
| 44 | 44 | return $macroCall; |
| 45 | 45 | } |
| 46 | 46 | } |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | * @param bool $static |
| 55 | 55 | * @return bool |
| 56 | 56 | */ |
| 57 | - protected function checkMacroConditions($static=false) |
|
| 57 | + protected function checkMacroConditions($static = false) |
|
| 58 | 58 | {
|
| 59 | 59 | return is_string($this->macro) && |
| 60 | 60 | Utils::isNamespaceExists($this->macro) && |
@@ -67,9 +67,9 @@ discard block |
||
| 67 | 67 | * @param bool $static |
| 68 | 68 | * @return bool |
| 69 | 69 | */ |
| 70 | - protected function checkMacroInstanceOf($static=false) |
|
| 70 | + protected function checkMacroInstanceOf($static = false) |
|
| 71 | 71 | {
|
| 72 | - if($static){
|
|
| 72 | + if ($static) {
|
|
| 73 | 73 | return true; |
| 74 | 74 | } |
| 75 | 75 | return $this->app->resolve($this->macro) instanceof MacroAbleContracts; |
@@ -82,11 +82,11 @@ discard block |
||
| 82 | 82 | * @param callable $callback |
| 83 | 83 | * @return mixed |
| 84 | 84 | */ |
| 85 | - public function get($method,callable $callback) |
|
| 85 | + public function get($method, callable $callback) |
|
| 86 | 86 | {
|
| 87 | - if($this->isMacro){
|
|
| 87 | + if ($this->isMacro) {
|
|
| 88 | 88 | |
| 89 | - if(method_exists($resolve = $this->app->resolve($this->macro),$method)){
|
|
| 89 | + if (method_exists($resolve = $this->app->resolve($this->macro), $method)) {
|
|
| 90 | 90 | return $resolve->macro($this->class); |
| 91 | 91 | } |
| 92 | 92 | } |
@@ -110,11 +110,11 @@ discard block |
||
| 110 | 110 | * @param $class |
| 111 | 111 | * @return $this |
| 112 | 112 | */ |
| 113 | - public function isMacro($class,$static=false) |
|
| 113 | + public function isMacro($class, $static = false) |
|
| 114 | 114 | {
|
| 115 | 115 | // if the macro class is a valid object, |
| 116 | 116 | // then this macro will return a boolean value if it has the specified methode. |
| 117 | - if($this->checkMacroConditions($static)){
|
|
| 117 | + if ($this->checkMacroConditions($static)) {
|
|
| 118 | 118 | |
| 119 | 119 | $this->isMacro = true; |
| 120 | 120 | $this->class = $class; |
@@ -142,10 +142,10 @@ discard block |
||
| 142 | 142 | * @param $method |
| 143 | 143 | * @return mixed |
| 144 | 144 | */ |
| 145 | - public function with($macro,$concrete,$method=null) |
|
| 145 | + public function with($macro, $concrete, $method = null) |
|
| 146 | 146 | {
|
| 147 | - if($this->macro === null){
|
|
| 148 | - return $this($macro)->isMacro($concrete)->get($method,function() use($concrete){
|
|
| 147 | + if ($this->macro===null) {
|
|
| 148 | + return $this($macro)->isMacro($concrete)->get($method, function() use($concrete){
|
|
| 149 | 149 | return $concrete; |
| 150 | 150 | }); |
| 151 | 151 | } |
@@ -159,9 +159,9 @@ discard block |
||
| 159 | 159 | * @param $method |
| 160 | 160 | * @return mixed |
| 161 | 161 | */ |
| 162 | - public function withStatic($macro,$concrete) |
|
| 162 | + public function withStatic($macro, $concrete) |
|
| 163 | 163 | {
|
| 164 | - return $this($macro)->isMacro($concrete,true)->get(null,is_callable($concrete) ? |
|
| 164 | + return $this($macro)->isMacro($concrete, true)->get(null, is_callable($concrete) ? |
|
| 165 | 165 | $concrete : function() use($concrete){
|
| 166 | 166 | return $concrete; |
| 167 | 167 | }); |
@@ -173,9 +173,9 @@ discard block |
||
| 173 | 173 | * @param null|string $macro |
| 174 | 174 | * @return $this |
| 175 | 175 | */ |
| 176 | - public function __invoke($macro=null) |
|
| 176 | + public function __invoke($macro = null) |
|
| 177 | 177 | {
|
| 178 | - if($macro!==null){
|
|
| 178 | + if ($macro!==null) {
|
|
| 179 | 179 | $this->macro = $macro; |
| 180 | 180 | } |
| 181 | 181 | return $this; |
@@ -12,9 +12,9 @@ discard block |
||
| 12 | 12 | * @param null $app |
| 13 | 13 | * @return string |
| 14 | 14 | */ |
| 15 | - public function app($app=null) |
|
| 15 | + public function app($app = null) |
|
| 16 | 16 | {
|
| 17 | - $app=($app===null) ? $this->appDetector() : $app; |
|
| 17 | + $app = ($app===null) ? $this->appDetector() : $app; |
|
| 18 | 18 | return StaticPathModel::appPath().''.DIRECTORY_SEPARATOR.''.Str::slashToBackSlash($app); |
| 19 | 19 | } |
| 20 | 20 | |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | * @param null $app |
| 39 | 39 | * @return string |
| 40 | 40 | */ |
| 41 | - public function appCall($app=null) |
|
| 41 | + public function appCall($app = null) |
|
| 42 | 42 | {
|
| 43 | 43 | return $this->appVersion($app).''.DIRECTORY_SEPARATOR.''.StaticPathList::$controller; |
| 44 | 44 | } |
@@ -56,9 +56,9 @@ discard block |
||
| 56 | 56 | * @param null $app |
| 57 | 57 | * @return string |
| 58 | 58 | */ |
| 59 | - public function appConfig($app=null) |
|
| 59 | + public function appConfig($app = null) |
|
| 60 | 60 | {
|
| 61 | - if(isset(core()->paths['config'])){
|
|
| 61 | + if (isset(core()->paths['config'])) {
|
|
| 62 | 62 | return core()->paths['config']; |
| 63 | 63 | } |
| 64 | 64 | return $this->appVersion($app).''.DIRECTORY_SEPARATOR.''.StaticPathList::$config; |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | * @param null $app |
| 69 | 69 | * @return string |
| 70 | 70 | */ |
| 71 | - public function appHelpers($app=null) |
|
| 71 | + public function appHelpers($app = null) |
|
| 72 | 72 | {
|
| 73 | 73 | return $this->appVersion($app).''.DIRECTORY_SEPARATOR.''.StaticPathList::$helpers; |
| 74 | 74 | } |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | * @param null $app |
| 102 | 102 | * @return mixed |
| 103 | 103 | */ |
| 104 | - public function appFactory($app=null) |
|
| 104 | + public function appFactory($app = null) |
|
| 105 | 105 | {
|
| 106 | 106 | return $this->appVersion($app).''.DIRECTORY_SEPARATOR.''.StaticPathList::$factory; |
| 107 | 107 | } |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | */ |
| 112 | 112 | public function appKernel() |
| 113 | 113 | {
|
| 114 | - $kernel = $this->app().''.DIRECTORY_SEPARATOR.''.StaticPathList::$kernel; |
|
| 114 | + $kernel = $this->app().''.DIRECTORY_SEPARATOR.''.StaticPathList::$kernel; |
|
| 115 | 115 | |
| 116 | 116 | return $kernel; |
| 117 | 117 | } |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | */ |
| 122 | 122 | public function appProvider() |
| 123 | 123 | {
|
| 124 | - $kernel = $this->app().''.DIRECTORY_SEPARATOR.''.StaticPathList::$kernel.''.DIRECTORY_SEPARATOR.''.StaticPathList::$provider; |
|
| 124 | + $kernel = $this->app().''.DIRECTORY_SEPARATOR.''.StaticPathList::$kernel.''.DIRECTORY_SEPARATOR.''.StaticPathList::$provider; |
|
| 125 | 125 | |
| 126 | 126 | return $kernel; |
| 127 | 127 | } |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | * @param null $app |
| 147 | 147 | * @return mixed |
| 148 | 148 | */ |
| 149 | - public function appLogger($app=null) |
|
| 149 | + public function appLogger($app = null) |
|
| 150 | 150 | {
|
| 151 | 151 | return $this->appVersion($app).''.DIRECTORY_SEPARATOR.'ServiceLogManager'; |
| 152 | 152 | } |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | * @param null $app |
| 156 | 156 | * @return mixed |
| 157 | 157 | */ |
| 158 | - public function appMiddleware($app=null) |
|
| 158 | + public function appMiddleware($app = null) |
|
| 159 | 159 | {
|
| 160 | 160 | return $this->appVersion($app).''.DIRECTORY_SEPARATOR.''.StaticPathList::$middleware; |
| 161 | 161 | } |
@@ -164,7 +164,7 @@ discard block |
||
| 164 | 164 | * @param null $app |
| 165 | 165 | * @return mixed |
| 166 | 166 | */ |
| 167 | - public function appMigration($app=null) |
|
| 167 | + public function appMigration($app = null) |
|
| 168 | 168 | {
|
| 169 | 169 | return $this->appVersion($app).''.DIRECTORY_SEPARATOR.''.StaticPathList::$migration; |
| 170 | 170 | } |
@@ -173,7 +173,7 @@ discard block |
||
| 173 | 173 | * @param null $app |
| 174 | 174 | * @return mixed |
| 175 | 175 | */ |
| 176 | - public function appModel($app=null) |
|
| 176 | + public function appModel($app = null) |
|
| 177 | 177 | {
|
| 178 | 178 | return $this->appVersion($app).''.DIRECTORY_SEPARATOR.''.StaticPathList::$model; |
| 179 | 179 | } |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | * @param null $app |
| 183 | 183 | * @return mixed |
| 184 | 184 | */ |
| 185 | - public function appException($app=null) |
|
| 185 | + public function appException($app = null) |
|
| 186 | 186 | {
|
| 187 | 187 | return $this->appVersion().''.DIRECTORY_SEPARATOR.''.StaticPathList::$exception; |
| 188 | 188 | } |
@@ -191,7 +191,7 @@ discard block |
||
| 191 | 191 | * @param null $app |
| 192 | 192 | * @return mixed |
| 193 | 193 | */ |
| 194 | - public function appOptionalEvents($app=null) |
|
| 194 | + public function appOptionalEvents($app = null) |
|
| 195 | 195 | {
|
| 196 | 196 | return $this->appVersion().''.DIRECTORY_SEPARATOR.''.StaticPathList::$events; |
| 197 | 197 | } |
@@ -200,7 +200,7 @@ discard block |
||
| 200 | 200 | * @param null $app |
| 201 | 201 | * @return mixed |
| 202 | 202 | */ |
| 203 | - public function appOptionalJob($app=null) |
|
| 203 | + public function appOptionalJob($app = null) |
|
| 204 | 204 | {
|
| 205 | 205 | return $this->appVersion($app).''.DIRECTORY_SEPARATOR.''.StaticPathList::$optional.''.DIRECTORY_SEPARATOR.''.StaticPathList::$job; |
| 206 | 206 | } |
@@ -209,7 +209,7 @@ discard block |
||
| 209 | 209 | * @param null $app |
| 210 | 210 | * @return mixed |
| 211 | 211 | */ |
| 212 | - public function appOptionalListeners($app=null) |
|
| 212 | + public function appOptionalListeners($app = null) |
|
| 213 | 213 | {
|
| 214 | 214 | return $this->appVersion().''.DIRECTORY_SEPARATOR.''.StaticPathList::$listeners; |
| 215 | 215 | } |
@@ -218,7 +218,7 @@ discard block |
||
| 218 | 218 | * @param null $app |
| 219 | 219 | * @return mixed |
| 220 | 220 | */ |
| 221 | - public function appOptionalSubscribers($app=null) |
|
| 221 | + public function appOptionalSubscribers($app = null) |
|
| 222 | 222 | {
|
| 223 | 223 | return $this->appVersion().''.DIRECTORY_SEPARATOR.''.StaticPathList::$listeners.''.DIRECTORY_SEPARATOR.''.StaticPathList::$subscribers; |
| 224 | 224 | } |
@@ -236,7 +236,7 @@ discard block |
||
| 236 | 236 | */ |
| 237 | 237 | public function appRepository() |
| 238 | 238 | {
|
| 239 | - $repository = $this->app().''.DIRECTORY_SEPARATOR.''.StaticPathList::$repository; |
|
| 239 | + $repository = $this->app().''.DIRECTORY_SEPARATOR.''.StaticPathList::$repository; |
|
| 240 | 240 | |
| 241 | 241 | return $repository; |
| 242 | 242 | } |
@@ -253,7 +253,7 @@ discard block |
||
| 253 | 253 | * @param null $app |
| 254 | 254 | * @return mixed |
| 255 | 255 | */ |
| 256 | - public function appOptionalSource($app=null) |
|
| 256 | + public function appOptionalSource($app = null) |
|
| 257 | 257 | {
|
| 258 | 258 | return $this->appVersion($app).''.DIRECTORY_SEPARATOR.''.StaticPathList::$optional.''.DIRECTORY_SEPARATOR.''.StaticPathList::$sourcePath; |
| 259 | 259 | } |
@@ -262,7 +262,7 @@ discard block |
||
| 262 | 262 | * @param null $app |
| 263 | 263 | * @return mixed |
| 264 | 264 | */ |
| 265 | - public function appOptionalWebservice($app=null) |
|
| 265 | + public function appOptionalWebservice($app = null) |
|
| 266 | 266 | {
|
| 267 | 267 | return $this->appVersion($app).''.DIRECTORY_SEPARATOR.''.StaticPathList::$optional.''.DIRECTORY_SEPARATOR.''.StaticPathList::$webservice; |
| 268 | 268 | } |
@@ -279,7 +279,7 @@ discard block |
||
| 279 | 279 | * @param null $app |
| 280 | 280 | * @return mixed |
| 281 | 281 | */ |
| 282 | - public function appServiceAnnotations($app=null) |
|
| 282 | + public function appServiceAnnotations($app = null) |
|
| 283 | 283 | {
|
| 284 | 284 | return $this->appVersion($app).''.DIRECTORY_SEPARATOR.''.StaticPathList::$serviceAnnotations; |
| 285 | 285 | } |
@@ -288,7 +288,7 @@ discard block |
||
| 288 | 288 | * @param null $app |
| 289 | 289 | * @return mixed |
| 290 | 290 | */ |
| 291 | - public function appServiceContainer($app=null) |
|
| 291 | + public function appServiceContainer($app = null) |
|
| 292 | 292 | {
|
| 293 | 293 | return $this->appVersion($app).''.DIRECTORY_SEPARATOR.'ServiceContainerController'; |
| 294 | 294 | } |
@@ -297,7 +297,7 @@ discard block |
||
| 297 | 297 | * @param null $app |
| 298 | 298 | * @return mixed |
| 299 | 299 | */ |
| 300 | - public function appServiceEventDispatcher($app=null) |
|
| 300 | + public function appServiceEventDispatcher($app = null) |
|
| 301 | 301 | {
|
| 302 | 302 | return $this->appVersion($app).''.DIRECTORY_SEPARATOR.'ServiceEventDispatcherManager'; |
| 303 | 303 | } |
@@ -306,7 +306,7 @@ discard block |
||
| 306 | 306 | * @param null $app |
| 307 | 307 | * @return mixed |
| 308 | 308 | */ |
| 309 | - public function appServiceMiddleware($app=null) |
|
| 309 | + public function appServiceMiddleware($app = null) |
|
| 310 | 310 | {
|
| 311 | 311 | return $this->appVersion($app).''.DIRECTORY_SEPARATOR.''.StaticPathList::$serviceMiddleware; |
| 312 | 312 | } |
@@ -333,9 +333,9 @@ discard block |
||
| 333 | 333 | * @param null $app |
| 334 | 334 | * @return mixed |
| 335 | 335 | */ |
| 336 | - public function appVersion($app=null) |
|
| 336 | + public function appVersion($app = null) |
|
| 337 | 337 | {
|
| 338 | - if(defined('app')){
|
|
| 338 | + if (defined('app')) {
|
|
| 339 | 339 | |
| 340 | 340 | $prefixGroup = Str::slashToBackSlash(StaticPathList::$projectPrefixGroup); |
| 341 | 341 | |
@@ -379,19 +379,19 @@ discard block |
||
| 379 | 379 | * @param bool $bool |
| 380 | 380 | * @return mixed |
| 381 | 381 | */ |
| 382 | - public function controller($controller=null,$bool=false) |
|
| 382 | + public function controller($controller = null, $bool = false) |
|
| 383 | 383 | {
|
| 384 | 384 | $namespaceController = ($controller===null) ? app()->namespace()->controller() |
| 385 | - : app()->namespace()->controller($controller,true); |
|
| 385 | + : app()->namespace()->controller($controller, true); |
|
| 386 | 386 | |
| 387 | - if($bool){
|
|
| 388 | - $namespaceControllerExplode = explode("\\",$namespaceController);
|
|
| 387 | + if ($bool) {
|
|
| 388 | + $namespaceControllerExplode = explode("\\", $namespaceController);
|
|
| 389 | 389 | array_pop($namespaceControllerExplode); |
| 390 | 390 | |
| 391 | - $namespaceController = implode("\\",$namespaceControllerExplode);
|
|
| 391 | + $namespaceController = implode("\\", $namespaceControllerExplode);
|
|
| 392 | 392 | } |
| 393 | 393 | |
| 394 | - return Utils::getPathFromNamespace($namespaceController,false); |
|
| 394 | + return Utils::getPathFromNamespace($namespaceController, false); |
|
| 395 | 395 | } |
| 396 | 396 | |
| 397 | 397 | /** |
@@ -415,9 +415,9 @@ discard block |
||
| 415 | 415 | * @param $arg |
| 416 | 416 | * @return mixed |
| 417 | 417 | */ |
| 418 | - public function __call($name,$arg) |
|
| 418 | + public function __call($name, $arg) |
|
| 419 | 419 | {
|
| 420 | - $appCall='app'.ucfirst($name); |
|
| 420 | + $appCall = 'app'.ucfirst($name); |
|
| 421 | 421 | return $this->{$appCall}();
|
| 422 | 422 | } |
| 423 | 423 | |