@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | * @param callable|null $func |
| 12 | 12 | * @return string |
| 13 | 13 | */ |
| 14 | - public function getNamespaceForAutoService($instance,callable $func = null) |
|
| 14 | + public function getNamespaceForAutoService($instance, callable $func = null) |
|
| 15 | 15 | {
|
| 16 | 16 | //get namespace for auto service |
| 17 | 17 | $autoServiceNamespace = $instance->autoService(); |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | $configAutoServices = config('autoservices');
|
| 22 | 22 | |
| 23 | 23 | //auto service is invoked if auto service is allowed for any class yada config. |
| 24 | - if(class_exists($autoServiceNamespace) && $configAutoServices[strtolower(endpoint)]){
|
|
| 24 | + if (class_exists($autoServiceNamespace) && $configAutoServices[strtolower(endpoint)]) {
|
|
| 25 | 25 | return $autoServiceNamespace; |
| 26 | 26 | } |
| 27 | 27 | |
@@ -12,17 +12,17 @@ |
||
| 12 | 12 | */ |
| 13 | 13 | public function watch(callable $callback) |
| 14 | 14 | {
|
| 15 | - if(config('app.watch')){
|
|
| 15 | + if (config('app.watch')) {
|
|
| 16 | 16 | |
| 17 | 17 | // the memory usage component provides |
| 18 | 18 | // a way to profile code. |
| 19 | 19 | $memoryUsage = memory_get_usage(); |
| 20 | 20 | |
| 21 | 21 | //get controller output |
| 22 | - $controllerOutput=call_user_func($callback); |
|
| 22 | + $controllerOutput = call_user_func($callback); |
|
| 23 | 23 | |
| 24 | 24 | //save to kernel for a variable named controller Watch |
| 25 | - $this->app->register('controllerWatch', 'memory',memory_get_usage() - $memoryUsage);
|
|
| 25 | + $this->app->register('controllerWatch', 'memory', memory_get_usage()-$memoryUsage);
|
|
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | // if watch config is true; in this case |
@@ -203,8 +203,7 @@ |
||
| 203 | 203 | if(file_exists($routeMapper) && !isset(static::$paths[$routeMapper])){
|
| 204 | 204 | static::$paths[$routeMapper] = $routeDefinitor['controllerPath']; |
| 205 | 205 | } |
| 206 | - } |
|
| 207 | - else{
|
|
| 206 | + } else{
|
|
| 208 | 207 | |
| 209 | 208 | // if there is no endpoint, |
| 210 | 209 | // all files in the path of the route are transferred to path. |
@@ -43,13 +43,13 @@ discard block |
||
| 43 | 43 | * @param $urlRoute |
| 44 | 44 | * @return int|string |
| 45 | 45 | */ |
| 46 | - public static function checkArrayEqual($patterns,$urlRoute) |
|
| 46 | + public static function checkArrayEqual($patterns, $urlRoute) |
|
| 47 | 47 | {
|
| 48 | 48 | // calculates the equality difference between |
| 49 | 49 | // the route pattern and the urlRoute value. |
| 50 | - foreach ($patterns as $key=>$pattern){
|
|
| 50 | + foreach ($patterns as $key=>$pattern) {
|
|
| 51 | 51 | |
| 52 | - if(Utils::isArrayEqual($pattern,$urlRoute)){
|
|
| 52 | + if (Utils::isArrayEqual($pattern, $urlRoute)) {
|
|
| 53 | 53 | return $key; |
| 54 | 54 | } |
| 55 | 55 | } |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | {
|
| 69 | 69 | $route = self::getRouteResolve(); |
| 70 | 70 | |
| 71 | - if(isset($route['class'])){
|
|
| 71 | + if (isset($route['class'])) {
|
|
| 72 | 72 | return $route['class']; |
| 73 | 73 | } |
| 74 | 74 | |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | {
|
| 85 | 85 | $route = self::getRouteResolve(); |
| 86 | 86 | |
| 87 | - if(isset($route['method'])){
|
|
| 87 | + if (isset($route['method'])) {
|
|
| 88 | 88 | return $route['method']; |
| 89 | 89 | } |
| 90 | 90 | |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | {
|
| 101 | 101 | $route = self::getRouteResolve(); |
| 102 | 102 | |
| 103 | - if(isset($route['controller'],$route['namespace'])){
|
|
| 103 | + if (isset($route['controller'], $route['namespace'])) {
|
|
| 104 | 104 | return $route['controller'].'/'.$route['namespace']; |
| 105 | 105 | } |
| 106 | 106 | |
@@ -117,17 +117,17 @@ discard block |
||
| 117 | 117 | // get routes data and the resolving pattern |
| 118 | 118 | // Both are interrelated. |
| 119 | 119 | $routes = self::getRoutes(); |
| 120 | - $patternResolve = app()->resolve(RouteMatching::class,['route'=>new self()])->getPatternResolve(); |
|
| 120 | + $patternResolve = app()->resolve(RouteMatching::class, ['route'=>new self()])->getPatternResolve(); |
|
| 121 | 121 | |
| 122 | 122 | // we set the route variables for the route assistant. |
| 123 | 123 | self::updateRouteParameters($patternResolve); |
| 124 | 124 | |
| 125 | 125 | //if routes data is available in pattern resolve. |
| 126 | - if(isset($routes['data'][$patternResolve])){
|
|
| 126 | + if (isset($routes['data'][$patternResolve])) {
|
|
| 127 | 127 | |
| 128 | 128 | // if the incoming http value is |
| 129 | 129 | // the same as the real request method, the data is processed. |
| 130 | - if($routes['data'][$patternResolve]['http'] == strtolower(httpMethod)){
|
|
| 130 | + if ($routes['data'][$patternResolve]['http']==strtolower(httpMethod)) {
|
|
| 131 | 131 | |
| 132 | 132 | // we are set the solved pattern to a variable. |
| 133 | 133 | $resolve = $routes['data'][$patternResolve]; |
@@ -154,22 +154,22 @@ discard block |
||
| 154 | 154 | {
|
| 155 | 155 | $list = []; |
| 156 | 156 | |
| 157 | - if(isset(static::$routes['pattern'][$patternResolvedKey])){
|
|
| 157 | + if (isset(static::$routes['pattern'][$patternResolvedKey])) {
|
|
| 158 | 158 | |
| 159 | 159 | $routeParameters = static::$routes['pattern'][$patternResolvedKey]; |
| 160 | 160 | $route = route(); |
| 161 | 161 | |
| 162 | - foreach($routeParameters as $key=>$param){
|
|
| 162 | + foreach ($routeParameters as $key=>$param) {
|
|
| 163 | 163 | |
| 164 | - $param = Str::replaceWordArray(['{','}','?'],'',$param);
|
|
| 164 | + $param = Str::replaceWordArray(['{', '}', '?'], '', $param);
|
|
| 165 | 165 | |
| 166 | - if(isset($route[$key])){
|
|
| 166 | + if (isset($route[$key])) {
|
|
| 167 | 167 | $list[$param] = $route[$key]; |
| 168 | 168 | } |
| 169 | 169 | } |
| 170 | 170 | } |
| 171 | 171 | |
| 172 | - app()->register('routeParams',$list);
|
|
| 172 | + app()->register('routeParams', $list);
|
|
| 173 | 173 | } |
| 174 | 174 | |
| 175 | 175 | /** |
@@ -177,11 +177,11 @@ discard block |
||
| 177 | 177 | * |
| 178 | 178 | * @param bool $endpoint |
| 179 | 179 | */ |
| 180 | - public function handle($endpoint=true) |
|
| 180 | + public function handle($endpoint = true) |
|
| 181 | 181 | {
|
| 182 | 182 | // we will record the path data for the route. |
| 183 | 183 | // We set the routeMapper variables and the route path. |
| 184 | - self::setPath(function(){
|
|
| 184 | + self::setPath(function() {
|
|
| 185 | 185 | |
| 186 | 186 | // we are sending |
| 187 | 187 | // the controller and routes.php path. |
@@ -193,7 +193,7 @@ discard block |
||
| 193 | 193 | |
| 194 | 194 | // in the paths data, |
| 195 | 195 | // we run the route mapper values and the route files one by one. |
| 196 | - foreach (self::$paths as $mapper=>$controller){
|
|
| 196 | + foreach (self::$paths as $mapper=>$controller) {
|
|
| 197 | 197 | core()->fileSystem->callFile($mapper); |
| 198 | 198 | } |
| 199 | 199 | } |
@@ -204,11 +204,11 @@ discard block |
||
| 204 | 204 | * @param callable $callback |
| 205 | 205 | * @param bool $endpoint |
| 206 | 206 | */ |
| 207 | - public static function setPath(callable $callback,$endpoint=true) |
|
| 207 | + public static function setPath(callable $callback, $endpoint = true) |
|
| 208 | 208 | {
|
| 209 | 209 | $routeDefinitor = call_user_func($callback); |
| 210 | 210 | |
| 211 | - if(isset($routeDefinitor['controllerPath']) && isset($routeDefinitor['routePath'])){
|
|
| 211 | + if (isset($routeDefinitor['controllerPath']) && isset($routeDefinitor['routePath'])) {
|
|
| 212 | 212 | |
| 213 | 213 | //the route paths to be saved to the mappers static property. |
| 214 | 214 | static::$mappers['routePaths'][] = $routeDefinitor['routePath']; |
@@ -216,22 +216,22 @@ discard block |
||
| 216 | 216 | |
| 217 | 217 | // if there is endpoint, |
| 218 | 218 | // then only that endpoint is transferred into the path |
| 219 | - if(defined('endpoint') && $endpoint){
|
|
| 219 | + if (defined('endpoint') && $endpoint) {
|
|
| 220 | 220 | |
| 221 | 221 | $routeName = endpoint.'Route.php'; |
| 222 | 222 | $routeMapper = $routeDefinitor['routePath'].''.DIRECTORY_SEPARATOR.''.$routeName; |
| 223 | 223 | |
| 224 | - if(file_exists($routeMapper) && !isset(static::$paths[$routeMapper])){
|
|
| 224 | + if (file_exists($routeMapper) && !isset(static::$paths[$routeMapper])) {
|
|
| 225 | 225 | static::$paths[$routeMapper] = $routeDefinitor['controllerPath']; |
| 226 | 226 | } |
| 227 | 227 | } |
| 228 | - else{
|
|
| 228 | + else {
|
|
| 229 | 229 | |
| 230 | 230 | // if there is no endpoint, |
| 231 | 231 | // all files in the path of the route are transferred to path. |
| 232 | 232 | $allFilesInThatRoutePath = Utils::glob($routeDefinitor['routePath']); |
| 233 | 233 | |
| 234 | - foreach ($allFilesInThatRoutePath as $item){
|
|
| 234 | + foreach ($allFilesInThatRoutePath as $item) {
|
|
| 235 | 235 | static::$paths[$item] = $routeDefinitor['controllerPath']; |
| 236 | 236 | } |
| 237 | 237 | } |
@@ -245,13 +245,13 @@ discard block |
||
| 245 | 245 | * @param $function |
| 246 | 246 | * @param null $controller |
| 247 | 247 | */ |
| 248 | - public static function setRoute($params,$function,$controller=null) |
|
| 248 | + public static function setRoute($params, $function, $controller = null) |
|
| 249 | 249 | {
|
| 250 | - [$pattern,$route] = $params; |
|
| 251 | - [$class,$method] = explode("@",$route);
|
|
| 250 | + [$pattern, $route] = $params; |
|
| 251 | + [$class, $method] = explode("@", $route);
|
|
| 252 | 252 | |
| 253 | 253 | $patternList = array_values( |
| 254 | - array_filter(explode("/",$pattern),'strlen')
|
|
| 254 | + array_filter(explode("/", $pattern), 'strlen')
|
|
| 255 | 255 | ); |
| 256 | 256 | |
| 257 | 257 | static::$routes['pattern'][] = $patternList; |
@@ -261,7 +261,7 @@ discard block |
||
| 261 | 261 | 'http' => $function, |
| 262 | 262 | 'controller' => $controller, |
| 263 | 263 | 'namespace' => static::$namespace, |
| 264 | - 'endpoint' => strtolower(str_replace(StaticPathList::$controllerBundleName,'',static::$namespace)) |
|
| 264 | + 'endpoint' => strtolower(str_replace(StaticPathList::$controllerBundleName, '', static::$namespace)) |
|
| 265 | 265 | ]; |
| 266 | 266 | } |
| 267 | 267 | |
@@ -271,11 +271,11 @@ discard block |
||
| 271 | 271 | * @param null $value |
| 272 | 272 | * @return bool |
| 273 | 273 | */ |
| 274 | - public static function isMatchVaribleRegexPattern($value=null) |
|
| 274 | + public static function isMatchVaribleRegexPattern($value = null) |
|
| 275 | 275 | {
|
| 276 | 276 | // determines if the variable that can be used |
| 277 | 277 | // in the route file meets the regex rule. |
| 278 | - return (preg_match('@\{(.*?)\}@is',$value)) ? true : false;
|
|
| 278 | + return (preg_match('@\{(.*?)\}@is', $value)) ? true : false;
|
|
| 279 | 279 | } |
| 280 | 280 | |
| 281 | 281 | |
@@ -285,11 +285,11 @@ discard block |
||
| 285 | 285 | * @param null $value |
| 286 | 286 | * @return bool |
| 287 | 287 | */ |
| 288 | - public static function isOptionalVaribleRegexPattern($value=null) |
|
| 288 | + public static function isOptionalVaribleRegexPattern($value = null) |
|
| 289 | 289 | {
|
| 290 | 290 | // determines if the variable that can be used |
| 291 | 291 | // in the route file meets the regex rule. |
| 292 | - return preg_match('@\{[a-z]+\?\}@is',$value) ? true : false;
|
|
| 292 | + return preg_match('@\{[a-z]+\?\}@is', $value) ? true : false;
|
|
| 293 | 293 | } |
| 294 | 294 | |
| 295 | 295 | /** |
@@ -314,7 +314,7 @@ discard block |
||
| 314 | 314 | $application->loadIfNotExistBoot(['middleware']); |
| 315 | 315 | $middlewareProvider = $application['middleware']; |
| 316 | 316 | |
| 317 | - foreach($routeData as $key=>$data) {
|
|
| 317 | + foreach ($routeData as $key=>$data) {
|
|
| 318 | 318 | |
| 319 | 319 | $middlewareProvider->setKeyOdds('endpoint', $data['endpoint']);
|
| 320 | 320 | $middlewareProvider->setKeyOdds('method', $data['method']);
|
@@ -327,7 +327,7 @@ discard block |
||
| 327 | 327 | $afterMiddleware = $middlewareProvider->getShow(); |
| 328 | 328 | |
| 329 | 329 | $endpoint = $data['endpoint']; |
| 330 | - $controllerNamespace = Utils::getNamespace($data['controller'] . '/' . $data['namespace'] . '/' . $data['class']); |
|
| 330 | + $controllerNamespace = Utils::getNamespace($data['controller'].'/'.$data['namespace'].'/'.$data['class']); |
|
| 331 | 331 | |
| 332 | 332 | $methodDocument = app()['reflection']($controllerNamespace)->reflectionMethodParams($data['method'])->document; |
| 333 | 333 | |
@@ -339,11 +339,11 @@ discard block |
||
| 339 | 339 | } |
| 340 | 340 | } |
| 341 | 341 | |
| 342 | - $mappings[$key]['endpoint'] = $endpoint . '/' . implode("/", $routePattern[$key]);
|
|
| 342 | + $mappings[$key]['endpoint'] = $endpoint.'/'.implode("/", $routePattern[$key]);
|
|
| 343 | 343 | $mappings[$key]['http'] = $data['http']; |
| 344 | 344 | $mappings[$key]['definition'] = $methodDefinition; |
| 345 | - $mappings[$key]['before'] = implode(",",$beforeMiddleware);
|
|
| 346 | - $mappings[$key]['after'] = implode(",",$afterMiddleware);
|
|
| 345 | + $mappings[$key]['before'] = implode(",", $beforeMiddleware);
|
|
| 346 | + $mappings[$key]['after'] = implode(",", $afterMiddleware);
|
|
| 347 | 347 | $mappings[$key]['doc'] = 'not available'; |
| 348 | 348 | |
| 349 | 349 | } |
@@ -9,7 +9,7 @@ discard block |
||
| 9 | 9 | /** |
| 10 | 10 | * @var array $routerSpecification |
| 11 | 11 | */ |
| 12 | - protected $routerSpecification=[ |
|
| 12 | + protected $routerSpecification = [ |
|
| 13 | 13 | 'pickRouter', |
| 14 | 14 | 'stackRouter' |
| 15 | 15 | ]; |
@@ -19,8 +19,8 @@ discard block |
||
| 19 | 19 | */ |
| 20 | 20 | private function pickRouter() |
| 21 | 21 | {
|
| 22 | - $singleton=core(); |
|
| 23 | - $singleton->routerSpecifications['router']=(isset($singleton->pick)) ? $singleton->pick[0] : $singleton->routerResult; |
|
| 22 | + $singleton = core(); |
|
| 23 | + $singleton->routerSpecifications['router'] = (isset($singleton->pick)) ? $singleton->pick[0] : $singleton->routerResult; |
|
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | /** |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | //These are the customizations that are available in the routerSpecification object. |
| 33 | 33 | //By running these individually, we assign reference values to the router variable, |
| 34 | 34 | //which is the actual kernel object, so route customization takes place. |
| 35 | - return $this->routerProcess(function($router){
|
|
| 35 | + return $this->routerProcess(function($router) {
|
|
| 36 | 36 | return $router; |
| 37 | 37 | }); |
| 38 | 38 | } |
@@ -44,17 +44,17 @@ discard block |
||
| 44 | 44 | private function routerProcess(callable $callback) |
| 45 | 45 | {
|
| 46 | 46 | //After running the router specification sequence one by one, we collect reference values for the kernel router. |
| 47 | - array_walk($this->routerSpecification,[$this,'routerSpecification']); |
|
| 47 | + array_walk($this->routerSpecification, [$this, 'routerSpecification']); |
|
| 48 | 48 | |
| 49 | 49 | //Then we return the routerSpecifications object that is assigned for the kernel to the router method. |
| 50 | - return call_user_func_array($callback,[core()->routerSpecifications['router']]); |
|
| 50 | + return call_user_func_array($callback, [core()->routerSpecifications['router']]); |
|
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | /** |
| 54 | 54 | * @param $specification |
| 55 | 55 | * @param $key |
| 56 | 56 | */ |
| 57 | - private function routerSpecification($specification,$key) |
|
| 57 | + private function routerSpecification($specification, $key) |
|
| 58 | 58 | {
|
| 59 | 59 | $this->{$specification}();
|
| 60 | 60 | } |
@@ -71,8 +71,8 @@ discard block |
||
| 71 | 71 | //if there is no singleton pick |
| 72 | 72 | //If this is the case, we collect these values and assign them to the router variable. |
| 73 | 73 | //if it is not, the router will send the default value to the output. |
| 74 | - if(!isset($singleton->pick)){
|
|
| 75 | - $singleton->routerSpecifications['router']=(isset($singleton->stack)) ? $singleton->stack : $singleton->routerResult; |
|
| 74 | + if (!isset($singleton->pick)) {
|
|
| 75 | + $singleton->routerSpecifications['router'] = (isset($singleton->stack)) ? $singleton->stack : $singleton->routerResult; |
|
| 76 | 76 | } |
| 77 | 77 | } |
| 78 | 78 | |
@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | public static function delete(...$params) : void |
| 16 | 16 | {
|
| 17 | 17 | // the DELETE method deletes the specified resource. |
| 18 | - static::setRoute($params,__FUNCTION__,static::getTracePath()); |
|
| 18 | + static::setRoute($params, __FUNCTION__, static::getTracePath()); |
|
| 19 | 19 | } |
| 20 | 20 | |
| 21 | 21 | /** |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | {
|
| 29 | 29 | // the GET method requests a representation of the specified resource. |
| 30 | 30 | // Requests using GET should only retrieve data. |
| 31 | - static::setRoute($params,__FUNCTION__,static::getTracePath()); |
|
| 31 | + static::setRoute($params, __FUNCTION__, static::getTracePath()); |
|
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | /** |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | {
|
| 59 | 59 | // the POST method is used to submit an entity to the specified resource, |
| 60 | 60 | // often causing a change in state or side effects on the server. |
| 61 | - static::setRoute($params,__FUNCTION__,static::getTracePath()); |
|
| 61 | + static::setRoute($params, __FUNCTION__, static::getTracePath()); |
|
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | /** |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | {
|
| 72 | 72 | // the PUT method replaces all current representations of |
| 73 | 73 | // the target resource with the request payload. |
| 74 | - static::setRoute($params,__FUNCTION__,static::getTracePath()); |
|
| 74 | + static::setRoute($params, __FUNCTION__, static::getTracePath()); |
|
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | /** |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | * @param bool $objectReturn |
| 26 | 26 | * @return mixed |
| 27 | 27 | */ |
| 28 | - public function login($credentials=array(),$objectReturn=false); |
|
| 28 | + public function login($credentials = array(), $objectReturn = false); |
|
| 29 | 29 | |
| 30 | 30 | /** |
| 31 | 31 | * @return mixed |
@@ -14,12 +14,12 @@ |
||
| 14 | 14 | * @param $auth |
| 15 | 15 | * @param $token |
| 16 | 16 | */ |
| 17 | - public function __construct($auth,$token) |
|
| 17 | + public function __construct($auth, $token) |
|
| 18 | 18 | {
|
| 19 | 19 | parent::__construct($auth); |
| 20 | 20 | |
| 21 | 21 | //token value received by client |
| 22 | - $this->token=$token; |
|
| 22 | + $this->token = $token; |
|
| 23 | 23 | |
| 24 | 24 | //query check |
| 25 | 25 | $this->logoutProcess(); |
@@ -77,7 +77,9 @@ |
||
| 77 | 77 | |
| 78 | 78 | // if you want to see the entire login manager object directly, |
| 79 | 79 | // send true to the objectReturn parameter. |
| 80 | - if($objectReturn) return $loginManager; |
|
| 80 | + if($objectReturn) {
|
|
| 81 | + return $loginManager; |
|
| 82 | + } |
|
| 81 | 83 | |
| 82 | 84 | // the login value stored in the params property of the login manager object will return a builder object. |
| 83 | 85 | // we will return the value of the login state as a boolean using the count method of this builder object. |
@@ -10,7 +10,7 @@ discard block |
||
| 10 | 10 | class AuthenticateProvider extends ConfigProvider implements AuthenticateContract |
| 11 | 11 | {
|
| 12 | 12 | //get auth response,auth exception,auth token and auth basic |
| 13 | - use AuthenticateResponse,AuthenticateException,AuthenticateToken,AuthenticateBasic; |
|
| 13 | + use AuthenticateResponse, AuthenticateException, AuthenticateToken, AuthenticateBasic; |
|
| 14 | 14 | |
| 15 | 15 | /** |
| 16 | 16 | * @var string |
@@ -26,8 +26,8 @@ discard block |
||
| 26 | 26 | {
|
| 27 | 27 | // we obtain the data value obtained via |
| 28 | 28 | // authenticate availability with the help of callback object. |
| 29 | - return $this->checkParamsViaAvailability(function(){
|
|
| 30 | - return (new AuthUserManager($this->currentDeviceToken(),$this))->allDeviceTokens(); |
|
| 29 | + return $this->checkParamsViaAvailability(function() {
|
|
| 30 | + return (new AuthUserManager($this->currentDeviceToken(), $this))->allDeviceTokens(); |
|
| 31 | 31 | }); |
| 32 | 32 | } |
| 33 | 33 | |
@@ -40,11 +40,11 @@ discard block |
||
| 40 | 40 | {
|
| 41 | 41 | // header to determine whether |
| 42 | 42 | // the token value is present and return a callback. |
| 43 | - return $this->checkTokenViaHeaders(function($token){
|
|
| 43 | + return $this->checkTokenViaHeaders(function($token) {
|
|
| 44 | 44 | |
| 45 | 45 | // we send the user-supplied token value |
| 46 | 46 | // to the authCheckManager object. |
| 47 | - new AuthCheckManager($this,$token); |
|
| 47 | + new AuthCheckManager($this, $token); |
|
| 48 | 48 | |
| 49 | 49 | // as a result we send output according to |
| 50 | 50 | // the boolean value from the checkResult method. |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | {
|
| 62 | 62 | // we obtain the data value obtained via |
| 63 | 63 | // authenticate availability with the help of callback object. |
| 64 | - return $this->checkParamsViaAvailability('data',function($data){
|
|
| 64 | + return $this->checkParamsViaAvailability('data', function($data) {
|
|
| 65 | 65 | return $data; |
| 66 | 66 | }); |
| 67 | 67 | } |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | */ |
| 76 | 76 | public function guard($guard) |
| 77 | 77 | {
|
| 78 | - $this->guard=$guard; |
|
| 78 | + $this->guard = $guard; |
|
| 79 | 79 | |
| 80 | 80 | $this->setAuthenticateNeeds(); |
| 81 | 81 | |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | * @param bool $objectReturn |
| 90 | 90 | * @return $this|mixed |
| 91 | 91 | */ |
| 92 | - public function login($credentials=null,$objectReturn=false) |
|
| 92 | + public function login($credentials = null, $objectReturn = false) |
|
| 93 | 93 | {
|
| 94 | 94 | // we will determine whether |
| 95 | 95 | // the http path is correct for this method. |
@@ -97,15 +97,15 @@ discard block |
||
| 97 | 97 | |
| 98 | 98 | // we invoke the login manager and the properties |
| 99 | 99 | // that this class creates will inform us about user input. |
| 100 | - $loginManager = new AuthLoginManager($credentials,$this); |
|
| 100 | + $loginManager = new AuthLoginManager($credentials, $this); |
|
| 101 | 101 | |
| 102 | 102 | // if you want to see the entire login manager object directly, |
| 103 | 103 | // send true to the objectReturn parameter. |
| 104 | - if($objectReturn) return $loginManager; |
|
| 104 | + if ($objectReturn) return $loginManager; |
|
| 105 | 105 | |
| 106 | 106 | // the login value stored in the params property of the login manager object will return a builder object. |
| 107 | 107 | // we will return the value of the login state as a boolean using the count method of this builder object. |
| 108 | - if($this->getModel()=="Default"){
|
|
| 108 | + if ($this->getModel()=="Default") {
|
|
| 109 | 109 | return $this->getResult(); |
| 110 | 110 | } |
| 111 | 111 | |
@@ -126,11 +126,11 @@ discard block |
||
| 126 | 126 | |
| 127 | 127 | // header to determine whether |
| 128 | 128 | // the token value is present and return a callback. |
| 129 | - return $this->checkTokenViaHeaders(function($token){
|
|
| 129 | + return $this->checkTokenViaHeaders(function($token) {
|
|
| 130 | 130 | |
| 131 | 131 | // we send the user-supplied token value |
| 132 | 132 | // to the authCheckManager object. |
| 133 | - new AuthLogoutManager($this,$token); |
|
| 133 | + new AuthLogoutManager($this, $token); |
|
| 134 | 134 | |
| 135 | 135 | // as a result we send output according to |
| 136 | 136 | // the boolean value from the checkResult method. |
@@ -147,8 +147,8 @@ discard block |
||
| 147 | 147 | {
|
| 148 | 148 | // we obtain the user value obtained via |
| 149 | 149 | // authenticate availability with the help of callback object. |
| 150 | - return $this->checkParamsViaAvailability(function(){
|
|
| 151 | - return (new AuthUserManager($this->currentDeviceToken(),$this))->userProcess(); |
|
| 150 | + return $this->checkParamsViaAvailability(function() {
|
|
| 151 | + return (new AuthUserManager($this->currentDeviceToken(), $this))->userProcess(); |
|
| 152 | 152 | }); |
| 153 | 153 | } |
| 154 | 154 | |
@@ -18,12 +18,12 @@ |
||
| 18 | 18 | */ |
| 19 | 19 | public function __construct() |
| 20 | 20 | {
|
| 21 | - if(config('cache.default')!==null){
|
|
| 21 | + if (config('cache.default')!==null) {
|
|
| 22 | 22 | |
| 23 | 23 | $default = config('cache.default');
|
| 24 | 24 | |
| 25 | 25 | $this->config['adapter'] = config('cache.stores.'.$default.'.driver') ?? exception()->invalidArgument('driver for '.$default.' within cache config is not valid');
|
| 26 | - $this->config['path'] = config('cache.stores.'.$default.'.path') ?? path()->appResourche().'/Cache' ;
|
|
| 26 | + $this->config['path'] = config('cache.stores.'.$default.'.path') ?? path()->appResourche().'/Cache';
|
|
| 27 | 27 | $this->config['expire'] = config('cache.stores.'.$default.'.expire') ?? 0;
|
| 28 | 28 | } |
| 29 | 29 | } |