@@ -22,18 +22,18 @@ |
||
22 | 22 | */ |
23 | 23 | public function handle() |
24 | 24 | { |
25 | - foreach ($this->tableFilters() as $table=>$files){ |
|
25 | + foreach ($this->tableFilters() as $table=>$files) { |
|
26 | 26 | |
27 | 27 | $table = strtolower($table); |
28 | 28 | |
29 | 29 | foreach ($files as $file) { |
30 | 30 | |
31 | - $getClassName = preg_replace('@(\d+)_@is','',$file); |
|
31 | + $getClassName = preg_replace('@(\d+)_@is', '', $file); |
|
32 | 32 | $className = $this->getClassName($getClassName); |
33 | 33 | |
34 | 34 | require_once ($file); |
35 | 35 | |
36 | - $capsule = new SchemaCapsule($this->config,$file,$table); |
|
36 | + $capsule = new SchemaCapsule($this->config, $file, $table); |
|
37 | 37 | |
38 | 38 | $this->list[$table][] = (new $className)->up($capsule); |
39 | 39 | } |
@@ -29,14 +29,14 @@ |
||
29 | 29 | { |
30 | 30 | $this->config = $config; |
31 | 31 | |
32 | - if(is_null(self::$instance)){ |
|
32 | + if (is_null(self::$instance)) { |
|
33 | 33 | |
34 | 34 | //get pdo dsn |
35 | - $dsn=''.$config['driver'].':host='.$config['host'].';dbname='.$config['database'].''; |
|
35 | + $dsn = ''.$config['driver'].':host='.$config['host'].';dbname='.$config['database'].''; |
|
36 | 36 | $this->connection = new \PDO($dsn, $config['user'], $config['password']); |
37 | 37 | $this->connection->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION); |
38 | 38 | |
39 | - self::$instance=true; |
|
39 | + self::$instance = true; |
|
40 | 40 | } |
41 | 41 | } |
42 | 42 |
@@ -11,19 +11,19 @@ discard block |
||
11 | 11 | */ |
12 | 12 | public function processHandler() |
13 | 13 | { |
14 | - return $this->errorHandler(function(){ |
|
14 | + return $this->errorHandler(function() { |
|
15 | 15 | |
16 | - foreach ($this->list as $table =>$datas){ |
|
16 | + foreach ($this->list as $table =>$datas) { |
|
17 | 17 | |
18 | - foreach ($datas as $data){ |
|
18 | + foreach ($datas as $data) { |
|
19 | 19 | |
20 | - $query = $this->queryBuilder($table,$data); |
|
20 | + $query = $this->queryBuilder($table, $data); |
|
21 | 21 | |
22 | 22 | $query = $query->handle(); |
23 | 23 | |
24 | - $status =($query['result']!==false) ? true : false; |
|
24 | + $status = ($query['result']!==false) ? true : false; |
|
25 | 25 | |
26 | - $results[]= [ |
|
26 | + $results[] = [ |
|
27 | 27 | 'success'=>$status, |
28 | 28 | 'file'=>$data->getFile(), |
29 | 29 | 'table'=>$table, |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | { |
51 | 51 | foreach ($objects as $object) |
52 | 52 | { |
53 | - if(count($object->getError())){ |
|
53 | + if (count($object->getError())) { |
|
54 | 54 | return 'error : '.$object->getFile().' -> '.$object->getError()[0].''; |
55 | 55 | } |
56 | 56 | } |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | * @param $credentials |
32 | 32 | * @param null|AuthLoginManager $manager |
33 | 33 | */ |
34 | - public function __construct($credentials,$manager) |
|
34 | + public function __construct($credentials, $manager) |
|
35 | 35 | { |
36 | 36 | //get credentials as default |
37 | 37 | $this->credentials = $credentials; |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | //get credential hash |
43 | 43 | $this->setCredentialHash(); |
44 | 44 | |
45 | - if($this->manager->getUsing()===false){ |
|
45 | + if ($this->manager->getUsing()===false) { |
|
46 | 46 | |
47 | 47 | // the request object will help you process |
48 | 48 | // the credentials and get them correctly. |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | { |
95 | 95 | $request = $this->manager->getAuth()->getRequest(); |
96 | 96 | |
97 | - if($request=='Default'){ |
|
97 | + if ($request=='Default') { |
|
98 | 98 | return new AuthenticateRequest($this); |
99 | 99 | } |
100 | 100 | |
@@ -122,8 +122,8 @@ discard block |
||
122 | 122 | private function setCredentialHash() |
123 | 123 | { |
124 | 124 | //set credential hash |
125 | - if(count($this->credentials)){ |
|
126 | - $this->credentialHash = md5(sha1(implode("|",$this->credentials))); |
|
125 | + if (count($this->credentials)) { |
|
126 | + $this->credentialHash = md5(sha1(implode("|", $this->credentials))); |
|
127 | 127 | } |
128 | 128 | } |
129 | 129 | } |
130 | 130 | \ No newline at end of file |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | { |
26 | 26 | // if the auth value does not carry |
27 | 27 | // the authenticateProvider instance value, an exception is thrown. |
28 | - if(!$auth instanceof AuthenticateProvider){ |
|
28 | + if (!$auth instanceof AuthenticateProvider) { |
|
29 | 29 | exception()->runtime('AuthenticateProvider instance is not valid'); |
30 | 30 | } |
31 | 31 | |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | // the imported builder object. |
41 | 41 | $this->driverBuilderInstance = new $driverBuilder($auth); |
42 | 42 | |
43 | - if(!$this->driverBuilderInstance instanceof BuilderContract){ |
|
43 | + if (!$this->driverBuilderInstance instanceof BuilderContract) { |
|
44 | 44 | exception()->runtime($driverBuilder.' is not instance of '.BuilderContract::class); |
45 | 45 | } |
46 | 46 | } |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | */ |
13 | 13 | protected function paramValues(...$params) |
14 | 14 | { |
15 | - [$type,$query] = $params; |
|
15 | + [$type, $query] = $params; |
|
16 | 16 | |
17 | 17 | // with query we bind the returned values to the params property of the auth object. |
18 | 18 | // and so the auth object will make a final return with these values. |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | |
23 | 23 | // if status is true, |
24 | 24 | // we add values for some user benefits to params global access. |
25 | - if($this->auth->params['status']){ |
|
25 | + if ($this->auth->params['status']) { |
|
26 | 26 | |
27 | 27 | $this->auth->params['auth'] = $query->get(); |
28 | 28 | $this->auth->params['data'] = $query->first(); |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | |
42 | 42 | // with query we bind the returned values to the params property of the auth object. |
43 | 43 | // and so the auth object will make a final return with these values. |
44 | - $this->paramValues('check',$query); |
|
44 | + $this->paramValues('check', $query); |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | /** |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | |
59 | 59 | // with query we bind the returned values to the params property of the auth object. |
60 | 60 | // and so the auth object will make a final return with these values. |
61 | - $this->paramValues('login',$query); |
|
61 | + $this->paramValues('login', $query); |
|
62 | 62 | |
63 | 63 | // we assign the credential hash value |
64 | 64 | // to the global of the authenticate object. |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | |
83 | 83 | // with query we bind the returned values to the params property of the auth object. |
84 | 84 | // and so the auth object will make a final return with these values. |
85 | - $this->paramValues('logout',$query); |
|
85 | + $this->paramValues('logout', $query); |
|
86 | 86 | |
87 | 87 | //token updating as null |
88 | 88 | $this->updateToken(md5(time())); |
@@ -7,12 +7,12 @@ discard block |
||
7 | 7 | /** |
8 | 8 | * @param callable $callback |
9 | 9 | */ |
10 | - protected function checkParamsViaAvailability($data,callable $callback) |
|
10 | + protected function checkParamsViaAvailability($data, callable $callback) |
|
11 | 11 | { |
12 | 12 | // if an authenticate is provided via the existing check method, |
13 | 13 | // then we return the value of the data that we are checking for with callback help. |
14 | - if($this->check() && isset($this->params[$data])){ |
|
15 | - return call_user_func_array($callback,[$this->params[$data]]); |
|
14 | + if ($this->check() && isset($this->params[$data])) { |
|
15 | + return call_user_func_array($callback, [$this->params[$data]]); |
|
16 | 16 | } |
17 | 17 | |
18 | 18 | return null; |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | |
28 | 28 | // we will determine whether |
29 | 29 | // the http path is correct for this method. |
30 | - if(isset($getHttp[$type]) and $getHttp[$type]!==httpMethod()){ |
|
30 | + if (isset($getHttp[$type]) and $getHttp[$type]!==httpMethod()) { |
|
31 | 31 | $this->getExceptionForHttp($getHttp[$type]); |
32 | 32 | } |
33 | 33 | } |
@@ -41,12 +41,12 @@ discard block |
||
41 | 41 | $headers = headers(); |
42 | 42 | |
43 | 43 | //get token key from config |
44 | - $tokenKey=$this->getTokenKey(); |
|
44 | + $tokenKey = $this->getTokenKey(); |
|
45 | 45 | |
46 | 46 | // if there is a token in the headers, |
47 | 47 | // we return the callback. |
48 | - if(isset($headers[$tokenKey])){ |
|
49 | - return call_user_func_array($callback,[$headers[$tokenKey][0]]); |
|
48 | + if (isset($headers[$tokenKey])) { |
|
49 | + return call_user_func_array($callback, [$headers[$tokenKey][0]]); |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | //token false |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | { |
39 | 39 | $this->config(); |
40 | 40 | |
41 | - if($this->guard=="default"){ |
|
41 | + if ($this->guard=="default") { |
|
42 | 42 | $this->setAuthenticateNeeds(); |
43 | 43 | } |
44 | 44 | } |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | */ |
63 | 63 | public function getAddToWhere() |
64 | 64 | { |
65 | - if(isset($this->config['guard'][$this->guard]['addToWhere'])){ |
|
65 | + if (isset($this->config['guard'][$this->guard]['addToWhere'])) { |
|
66 | 66 | return $this->config['guard'][$this->guard]['addToWhere']; |
67 | 67 | } |
68 | 68 | return null; |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | */ |
76 | 76 | public function getConfigToken() |
77 | 77 | { |
78 | - if(isset($this->config['guard'][$this->guard]['token'])){ |
|
78 | + if (isset($this->config['guard'][$this->guard]['token'])) { |
|
79 | 79 | return $this->config['guard'][$this->guard]['token']; |
80 | 80 | } |
81 | 81 | return null; |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | { |
101 | 101 | $this->getModel(); |
102 | 102 | |
103 | - if($this->model=="Default"){ |
|
103 | + if ($this->model=="Default") { |
|
104 | 104 | |
105 | 105 | return $this->driverDefaultNamespace.'\\'.$this->getDriver().'\\UserBuilder'; |
106 | 106 | } |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | { |
128 | 128 | $this->getModel(); |
129 | 129 | |
130 | - if($this->model=="Default"){ |
|
130 | + if ($this->model=="Default") { |
|
131 | 131 | |
132 | 132 | return $this->driverDefaultNamespace.'\\'.$this->getDriver().'\\User'; |
133 | 133 | } |