@@ -9,6 +9,6 @@ |
||
| 9 | 9 | * @param array $uniques |
| 10 | 10 | * @return mixed |
| 11 | 11 | */ |
| 12 | - public function uniques($unique_name,$uniques=array()); |
|
| 12 | + public function uniques($unique_name, $uniques = array()); |
|
| 13 | 13 | } |
| 14 | 14 | |
@@ -9,6 +9,6 @@ |
||
| 9 | 9 | * @param array $indexes |
| 10 | 10 | * @return mixed |
| 11 | 11 | */ |
| 12 | - public function indexes($index_name,$indexes=array()); |
|
| 12 | + public function indexes($index_name, $indexes = array()); |
|
| 13 | 13 | } |
| 14 | 14 | |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | */ |
| 91 | 91 | private function getWizardAlterInstance($group) |
| 92 | 92 | { |
| 93 | - $this->setAlterType('group',$group); |
|
| 93 | + $this->setAlterType('group', $group); |
|
| 94 | 94 | |
| 95 | 95 | return new WizardAlter($this); |
| 96 | 96 | } |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | */ |
| 102 | 102 | private function dropWizardAlterInstance($group) |
| 103 | 103 | { |
| 104 | - $this->setAlterType('group',$group); |
|
| 104 | + $this->setAlterType('group', $group); |
|
| 105 | 105 | |
| 106 | 106 | return $this; |
| 107 | 107 | } |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | */ |
| 113 | 113 | private function dropKeyWizardAlterInstance($group) |
| 114 | 114 | { |
| 115 | - $this->setAlterType('group',$group); |
|
| 115 | + $this->setAlterType('group', $group); |
|
| 116 | 116 | |
| 117 | 117 | return $this; |
| 118 | 118 | } |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | */ |
| 124 | 124 | private function addIndexWizardAlterInstance($group) |
| 125 | 125 | { |
| 126 | - $this->setAlterType('group',$group); |
|
| 126 | + $this->setAlterType('group', $group); |
|
| 127 | 127 | |
| 128 | 128 | return $this; |
| 129 | 129 | } |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | */ |
| 135 | 135 | private function addUniqueWizardAlterInstance($group) |
| 136 | 136 | { |
| 137 | - $this->setAlterType('group',$group); |
|
| 137 | + $this->setAlterType('group', $group); |
|
| 138 | 138 | |
| 139 | 139 | return $this; |
| 140 | 140 | } |
@@ -14,44 +14,44 @@ discard block |
||
| 14 | 14 | */ |
| 15 | 15 | public function processHandler() |
| 16 | 16 | { |
| 17 | - return $this->errorHandler(function(){ |
|
| 17 | + return $this->errorHandler(function() { |
|
| 18 | 18 | |
| 19 | 19 | $results = []; |
| 20 | 20 | |
| 21 | - foreach ($this->list as $table =>$datas){ |
|
| 21 | + foreach ($this->list as $table =>$datas) { |
|
| 22 | 22 | |
| 23 | - foreach ($datas as $data){ |
|
| 23 | + foreach ($datas as $data) { |
|
| 24 | 24 | |
| 25 | - $query = $this->queryBuilder($table,$data); |
|
| 25 | + $query = $this->queryBuilder($table, $data); |
|
| 26 | 26 | |
| 27 | 27 | $query = $query->handle(); |
| 28 | 28 | |
| 29 | - if($query===false){ |
|
| 29 | + if ($query===false) { |
|
| 30 | 30 | $results[] = []; |
| 31 | 31 | } |
| 32 | - else{ |
|
| 33 | - $status =($query['result']!==false) ? true : false; |
|
| 32 | + else { |
|
| 33 | + $status = ($query['result']!==false) ? true : false; |
|
| 34 | 34 | |
| 35 | - if($status){ |
|
| 35 | + if ($status) { |
|
| 36 | 36 | |
| 37 | - $this->schema->getConnection()->registerMigration($table,$data->getFile()); |
|
| 37 | + $this->schema->getConnection()->registerMigration($table, $data->getFile()); |
|
| 38 | 38 | |
| 39 | - if(app()->isLocale()){ |
|
| 39 | + if (app()->isLocale()) { |
|
| 40 | 40 | |
| 41 | 41 | $this->schema->getConnection()->generateEntity($table); |
| 42 | 42 | |
| 43 | - if(substr($table,-1)=='s'){ |
|
| 44 | - app()->command('model create','model:'.strtolower(substr($table,0,-1)).' table:'.$table.' entity:'.$table); |
|
| 43 | + if (substr($table, -1)=='s') { |
|
| 44 | + app()->command('model create', 'model:'.strtolower(substr($table, 0, -1)).' table:'.$table.' entity:'.$table); |
|
| 45 | 45 | } |
| 46 | - else{ |
|
| 47 | - app()->command('model create','model:'.strtolower($table).' table:'.$table.' entity:'.$table); |
|
| 46 | + else { |
|
| 47 | + app()->command('model create', 'model:'.strtolower($table).' table:'.$table.' entity:'.$table); |
|
| 48 | 48 | } |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | - $results[]= [ |
|
| 54 | + $results[] = [ |
|
| 55 | 55 | 'success'=>$status, |
| 56 | 56 | 'file'=>$data->getFile(), |
| 57 | 57 | 'table'=>$table, |
@@ -81,11 +81,11 @@ discard block |
||
| 81 | 81 | { |
| 82 | 82 | $alterBinds = $object->getAlterBinds(); |
| 83 | 83 | |
| 84 | - if(!is_null($alterBinds) && count($alterBinds)>1){ |
|
| 84 | + if (!is_null($alterBinds) && count($alterBinds)>1) { |
|
| 85 | 85 | exception()->runtime('Only one command can be applied to alter groups'); |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | - if(count($object->getError())){ |
|
| 88 | + if (count($object->getError())) { |
|
| 89 | 89 | exception()->runtime(''.$object->getFile().' -> '.$object->getError()[0].''); |
| 90 | 90 | } |
| 91 | 91 | |
@@ -28,8 +28,7 @@ discard block |
||
| 28 | 28 | |
| 29 | 29 | if($query===false){ |
| 30 | 30 | $results[] = []; |
| 31 | - } |
|
| 32 | - else{ |
|
| 31 | + } else{ |
|
| 33 | 32 | $status =($query['result']!==false) ? true : false; |
| 34 | 33 | |
| 35 | 34 | if($status){ |
@@ -42,8 +41,7 @@ discard block |
||
| 42 | 41 | |
| 43 | 42 | if(substr($table,-1)=='s'){ |
| 44 | 43 | app()->command('model create','model:'.strtolower(substr($table,0,-1)).' table:'.$table.' entity:'.$table); |
| 45 | - } |
|
| 46 | - else{ |
|
| 44 | + } else{ |
|
| 47 | 45 | app()->command('model create','model:'.strtolower($table).' table:'.$table.' entity:'.$table); |
| 48 | 46 | } |
| 49 | 47 | } |
@@ -16,7 +16,7 @@ |
||
| 16 | 16 | */ |
| 17 | 17 | public static function permissionMake($routeName) |
| 18 | 18 | {
|
| 19 | - $permission = static::where('route_name',$routeName)->where('role_id',auth()->user()->role_id);
|
|
| 19 | + $permission = static::where('route_name', $routeName)->where('role_id', auth()->user()->role_id);
|
|
| 20 | 20 | |
| 21 | 21 | return ($permission->count()) ? true : false; |
| 22 | 22 | } |
@@ -16,17 +16,17 @@ |
||
| 16 | 16 | */ |
| 17 | 17 | public static function roleMake($role) |
| 18 | 18 | {
|
| 19 | - $roleCriteria = explode(':',$role);
|
|
| 19 | + $roleCriteria = explode(':', $role);
|
|
| 20 | 20 | |
| 21 | - if(isset($roleCriteria[1])){
|
|
| 22 | - $role = static::where('name',$roleCriteria[0])->
|
|
| 23 | - where('status',1)->where('is_deleted',0)->where('role_state',$roleCriteria[1])->first();
|
|
| 21 | + if (isset($roleCriteria[1])) {
|
|
| 22 | + $role = static::where('name', $roleCriteria[0])->
|
|
| 23 | + where('status', 1)->where('is_deleted', 0)->where('role_state', $roleCriteria[1])->first();
|
|
| 24 | 24 | |
| 25 | - if(is_null($role)){
|
|
| 25 | + if (is_null($role)) {
|
|
| 26 | 26 | exception('roleDefinitorException')->runtime('roleDefinitorException');
|
| 27 | 27 | } |
| 28 | 28 | |
| 29 | - if(auth()->user()->role_id == $role->id){
|
|
| 29 | + if (auth()->user()->role_id==$role->id) {
|
|
| 30 | 30 | return true; |
| 31 | 31 | } |
| 32 | 32 | |
@@ -64,10 +64,10 @@ discard block |
||
| 64 | 64 | $permission = $this->getPermission(); |
| 65 | 65 | $role = $this->getRole(); |
| 66 | 66 | |
| 67 | - if(is_null($this->role)){ |
|
| 67 | + if (is_null($this->role)) { |
|
| 68 | 68 | return $permission::permissionMake($this->routeName); |
| 69 | 69 | } |
| 70 | - else{ |
|
| 70 | + else { |
|
| 71 | 71 | return $role::roleMake($this->role); |
| 72 | 72 | } |
| 73 | 73 | } |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | * @param string $adapter |
| 105 | 105 | * @return RoleManager |
| 106 | 106 | */ |
| 107 | - public function setAdapter($adapter='Database') |
|
| 107 | + public function setAdapter($adapter = 'Database') |
|
| 108 | 108 | { |
| 109 | 109 | $this->adapter = $adapter; |
| 110 | 110 | |
@@ -66,8 +66,7 @@ |
||
| 66 | 66 | |
| 67 | 67 | if(is_null($this->role)){ |
| 68 | 68 | return $permission::permissionMake($this->routeName); |
| 69 | - } |
|
| 70 | - else{ |
|
| 69 | + } else{ |
|
| 71 | 70 | return $role::roleMake($this->role); |
| 72 | 71 | } |
| 73 | 72 | } |
@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | /** |
| 14 | 14 | * @var $type |
| 15 | 15 | */ |
| 16 | - public $type='token'; |
|
| 16 | + public $type = 'token'; |
|
| 17 | 17 | |
| 18 | 18 | /** |
| 19 | 19 | * @var array |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | /** |
| 31 | 31 | * @var $commandRule |
| 32 | 32 | */ |
| 33 | - public $commandRule=['key']; |
|
| 33 | + public $commandRule = ['key']; |
|
| 34 | 34 | |
| 35 | 35 | /** |
| 36 | 36 | * @return void |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | $resolveClientApiToken = app()->resolve($clientApiToken); |
| 42 | 42 | |
| 43 | 43 | // |
| 44 | - $key= lcfirst($this->argument['key']); |
|
| 44 | + $key = lcfirst($this->argument['key']); |
|
| 45 | 45 | |
| 46 | 46 | echo $this->info($resolveClientApiToken->createToken($key)); |
| 47 | 47 | } |
@@ -51,8 +51,7 @@ discard block |
||
| 51 | 51 | $itemList = explode('=',$item); |
| 52 | 52 | if(isset($this->output[$itemList[0]]) && $this->output[$itemList[0]]==$itemList[1]){ |
| 53 | 53 | $filterResult[] = true; |
| 54 | - } |
|
| 55 | - else{ |
|
| 54 | + } else{ |
|
| 56 | 55 | $filterResult[] = false; |
| 57 | 56 | } |
| 58 | 57 | } |
@@ -65,8 +64,7 @@ discard block |
||
| 65 | 64 | echo ''.$this->output['trackNumber'].' - SUCCESS:'; |
| 66 | 65 | echo PHP_EOL; |
| 67 | 66 | echo 'Request Success : true'; |
| 68 | - } |
|
| 69 | - else{ |
|
| 67 | + } else{ |
|
| 70 | 68 | |
| 71 | 69 | echo ''.$this->output['trackNumber'].' - ERROR:'; |
| 72 | 70 | echo PHP_EOL; |
@@ -23,11 +23,11 @@ discard block |
||
| 23 | 23 | * @param $output |
| 24 | 24 | * @param $arguments |
| 25 | 25 | */ |
| 26 | - public function __construct(ApplicationContracts $app,$output,$arguments) |
|
| 26 | + public function __construct(ApplicationContracts $app, $output, $arguments) |
|
| 27 | 27 | { |
| 28 | 28 | parent::__construct($app); |
| 29 | 29 | |
| 30 | - if(!$this->app->runningInConsole()){ |
|
| 30 | + if (!$this->app->runningInConsole()) { |
|
| 31 | 31 | exception()->runtime('Console application is missing'); |
| 32 | 32 | } |
| 33 | 33 | |
@@ -60,31 +60,31 @@ discard block |
||
| 60 | 60 | */ |
| 61 | 61 | public function handle($callback) |
| 62 | 62 | { |
| 63 | - if(isset($this->arguments['filter'])){ |
|
| 63 | + if (isset($this->arguments['filter'])) { |
|
| 64 | 64 | |
| 65 | 65 | $filterResult = []; |
| 66 | 66 | $filter = lcfirst($this->arguments['filter']); |
| 67 | 67 | |
| 68 | - foreach (explode('+',$filter) as $item){ |
|
| 69 | - $itemList = explode('=',$item); |
|
| 70 | - if(isset($this->output[$itemList[0]]) && $this->output[$itemList[0]]==$itemList[1]){ |
|
| 68 | + foreach (explode('+', $filter) as $item) { |
|
| 69 | + $itemList = explode('=', $item); |
|
| 70 | + if (isset($this->output[$itemList[0]]) && $this->output[$itemList[0]]==$itemList[1]) { |
|
| 71 | 71 | $filterResult[] = true; |
| 72 | 72 | } |
| 73 | - else{ |
|
| 73 | + else { |
|
| 74 | 74 | $filterResult[] = false; |
| 75 | 75 | } |
| 76 | 76 | } |
| 77 | 77 | } |
| 78 | 78 | |
| 79 | - if(!isset($filterResult) || (isset($filterResult) && is_array($filterResult) && !in_array(false,$filterResult))){ |
|
| 79 | + if (!isset($filterResult) || (isset($filterResult) && is_array($filterResult) && !in_array(false, $filterResult))) { |
|
| 80 | 80 | |
| 81 | - if($this->output['meta']['success']) |
|
| 81 | + if ($this->output['meta']['success']) |
|
| 82 | 82 | { |
| 83 | 83 | echo ''.$this->output['trackNumber'].' - SUCCESS:'; |
| 84 | 84 | echo PHP_EOL; |
| 85 | 85 | echo 'Request Success : true'; |
| 86 | 86 | } |
| 87 | - else{ |
|
| 87 | + else { |
|
| 88 | 88 | |
| 89 | 89 | echo ''.$this->output['trackNumber'].' - ERROR:'; |
| 90 | 90 | echo PHP_EOL; |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | |
| 103 | 103 | echo PHP_EOL; |
| 104 | 104 | $requestClientIp = (isset($this->output['clientIp'])) ? $this->output['clientIp'] : null; |
| 105 | - echo 'Client Ip: '.$requestClientIp ; |
|
| 105 | + echo 'Client Ip: '.$requestClientIp; |
|
| 106 | 106 | |
| 107 | 107 | echo PHP_EOL; |
| 108 | 108 | $requestEndpoint = (isset($this->output['requestUrl'])) ? $this->output['requestUrl'] : null; |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | echo 'Client Key: '.$requestClientKey; |
| 127 | 127 | |
| 128 | 128 | echo PHP_EOL; |
| 129 | - if(is_callable($callback)){ |
|
| 129 | + if (is_callable($callback)) { |
|
| 130 | 130 | echo $callback($this); |
| 131 | 131 | } |
| 132 | 132 | |