@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | */ |
22 | 22 | public function __construct($wizard) |
23 | 23 | { |
24 | - $this->wizard=$wizard; |
|
24 | + $this->wizard = $wizard; |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | /** |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | */ |
31 | 31 | public function collation($value = 'utf8') |
32 | 32 | { |
33 | - $this->wizard->collation($value,'true'); |
|
33 | + $this->wizard->collation($value, 'true'); |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | /** |
@@ -55,13 +55,13 @@ discard block |
||
55 | 55 | * @param null $comment |
56 | 56 | * @return IndexPropertiesContract |
57 | 57 | */ |
58 | - public function indexes($index_name, $fields = array(),$comment=null) |
|
58 | + public function indexes($index_name, $fields = array(), $comment = null) |
|
59 | 59 | { |
60 | - $this->wizard->index($index_name,$fields,true); |
|
60 | + $this->wizard->index($index_name, $fields, true); |
|
61 | 61 | |
62 | - if($comment!==null) $this->wizard->updateIndexesForSpecialist($index_name,$comment,'comment'); |
|
62 | + if ($comment!==null) $this->wizard->updateIndexesForSpecialist($index_name, $comment, 'comment'); |
|
63 | 63 | |
64 | - return new IndexProperties($index_name,$this->wizard); |
|
64 | + return new IndexProperties($index_name, $this->wizard); |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | } |
@@ -59,7 +59,9 @@ |
||
59 | 59 | { |
60 | 60 | $this->wizard->index($index_name,$fields,true); |
61 | 61 | |
62 | - if($comment!==null) $this->wizard->updateIndexesForSpecialist($index_name,$comment,'comment'); |
|
62 | + if($comment!==null) { |
|
63 | + $this->wizard->updateIndexesForSpecialist($index_name,$comment,'comment'); |
|
64 | + } |
|
63 | 65 | |
64 | 66 | return new IndexProperties($index_name,$this->wizard); |
65 | 67 | } |
@@ -12,14 +12,14 @@ discard block |
||
12 | 12 | /** |
13 | 13 | * @var string |
14 | 14 | */ |
15 | - private $fieldKey='Field'; |
|
15 | + private $fieldKey = 'Field'; |
|
16 | 16 | |
17 | 17 | /** |
18 | 18 | * @param $columns |
19 | 19 | */ |
20 | 20 | public function columnsProcess($columns) |
21 | 21 | { |
22 | - $this->columns=$columns; |
|
22 | + $this->columns = $columns; |
|
23 | 23 | } |
24 | 24 | |
25 | 25 | /** |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | * @param array $tables |
35 | 35 | * @return array |
36 | 36 | */ |
37 | - public function fields($tables=array()) |
|
37 | + public function fields($tables = array()) |
|
38 | 38 | { |
39 | 39 | $list = []; |
40 | 40 | |
@@ -42,13 +42,13 @@ discard block |
||
42 | 42 | { |
43 | 43 | foreach ($columns as $columnData) |
44 | 44 | { |
45 | - if(count($tables)){ |
|
45 | + if (count($tables)) { |
|
46 | 46 | |
47 | - if(in_array($table,$tables)){ |
|
47 | + if (in_array($table, $tables)) { |
|
48 | 48 | $list[$table][] = $columnData[$this->fieldKey]; |
49 | 49 | } |
50 | 50 | } |
51 | - else{ |
|
51 | + else { |
|
52 | 52 | $list[$table][] = $columnData[$this->fieldKey]; |
53 | 53 | } |
54 | 54 | } |
@@ -47,8 +47,7 @@ |
||
47 | 47 | if(in_array($table,$tables)){ |
48 | 48 | $list[$table][] = $columnData[$this->fieldKey]; |
49 | 49 | } |
50 | - } |
|
51 | - else{ |
|
50 | + } else{ |
|
52 | 51 | $list[$table][] = $columnData[$this->fieldKey]; |
53 | 52 | } |
54 | 53 | } |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | |
10 | 10 | class QueryBase implements QueryBaseContract |
11 | 11 | { |
12 | - use QueryStack,ColumnsProcess; |
|
12 | + use QueryStack, ColumnsProcess; |
|
13 | 13 | |
14 | 14 | /** |
15 | 15 | * @return mixed |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | |
29 | 29 | $list = []; |
30 | 30 | |
31 | - foreach ($tables as $key=>$resource){ |
|
31 | + foreach ($tables as $key=>$resource) { |
|
32 | 32 | |
33 | 33 | $list[$key] = $resource[0]; |
34 | 34 | } |
@@ -40,15 +40,15 @@ discard block |
||
40 | 40 | * @param array $tables |
41 | 41 | * @return ColumnsProcessContract |
42 | 42 | */ |
43 | - public function getColumns($tables=array()) |
|
43 | + public function getColumns($tables = array()) |
|
44 | 44 | { |
45 | 45 | $tableList = (count($tables)) ? $tables : $this->getTables(); |
46 | 46 | |
47 | 47 | $list = []; |
48 | 48 | |
49 | - foreach ($tableList as $table){ |
|
49 | + foreach ($tableList as $table) { |
|
50 | 50 | |
51 | - if(in_array($table,$this->getTables())){ |
|
51 | + if (in_array($table, $this->getTables())) { |
|
52 | 52 | $list[$table] = $this->showColumnsFrom($table); |
53 | 53 | } |
54 | 54 | } |
@@ -93,7 +93,7 @@ |
||
93 | 93 | //get path and set mkdir |
94 | 94 | $path = $mainPath.'/'.ucfirst($table); |
95 | 95 | if(!file_exists($path)){ |
96 | - $mkdirResults[] = mkdir($path, 0777); |
|
96 | + $mkdirResults[] = mkdir($path, 0777); |
|
97 | 97 | } |
98 | 98 | } |
99 | 99 | } |
@@ -35,10 +35,10 @@ discard block |
||
35 | 35 | |
36 | 36 | $paths = self::$paths; |
37 | 37 | |
38 | - foreach ($paths as $path){ |
|
38 | + foreach ($paths as $path) { |
|
39 | 39 | $globPaths = array_filter(glob($path.'/*'), 'is_dir'); |
40 | - foreach ($globPaths as $reelPath){ |
|
41 | - $list[]=$reelPath; |
|
40 | + foreach ($globPaths as $reelPath) { |
|
41 | + $list[] = $reelPath; |
|
42 | 42 | } |
43 | 43 | } |
44 | 44 | |
@@ -54,11 +54,11 @@ discard block |
||
54 | 54 | |
55 | 55 | $list = []; |
56 | 56 | |
57 | - foreach ($directories as $directory){ |
|
57 | + foreach ($directories as $directory) { |
|
58 | 58 | |
59 | 59 | foreach (glob($directory."/*.php") as $file) { |
60 | 60 | |
61 | - $list[self::getFileName($directory)][]=$file; |
|
61 | + $list[self::getFileName($directory)][] = $file; |
|
62 | 62 | } |
63 | 63 | } |
64 | 64 | |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | */ |
72 | 72 | public static function getFileName($path) |
73 | 73 | { |
74 | - $pathParse = explode ("/",$path); |
|
74 | + $pathParse = explode("/", $path); |
|
75 | 75 | |
76 | 76 | return end($pathParse); |
77 | 77 | } |
@@ -87,18 +87,18 @@ discard block |
||
87 | 87 | |
88 | 88 | $mkdirResults = []; |
89 | 89 | |
90 | - foreach ($tables as $table){ |
|
91 | - if(!isset($directories[$table])){ |
|
90 | + foreach ($tables as $table) { |
|
91 | + if (!isset($directories[$table])) { |
|
92 | 92 | |
93 | 93 | //get path and set mkdir |
94 | 94 | $path = $mainPath.'/'.ucfirst($table); |
95 | - if(!file_exists($path)){ |
|
95 | + if (!file_exists($path)) { |
|
96 | 96 | $mkdirResults[] = mkdir($path, 0777); |
97 | 97 | } |
98 | 98 | } |
99 | 99 | } |
100 | 100 | |
101 | - dd(self::getAllDirectories(),$tables,$mkdirResults); |
|
101 | + dd(self::getAllDirectories(), $tables, $mkdirResults); |
|
102 | 102 | } |
103 | 103 | } |
104 | 104 |
@@ -92,8 +92,7 @@ discard block |
||
92 | 92 | |
93 | 93 | if(!file_exists($tableDirectory)){ |
94 | 94 | $results['directory'][$pathKey]= $this->fileProcess($tableDirectory,'makeDirectory'); |
95 | - } |
|
96 | - else{ |
|
95 | + } else{ |
|
97 | 96 | $results['directory'][$pathKey]= $this->getResult(false, |
98 | 97 | 'Already exist the specified directory'); |
99 | 98 | } |
@@ -110,8 +109,7 @@ discard block |
||
110 | 109 | |
111 | 110 | if(!file_exists($filePath)){ |
112 | 111 | $results['file'][$pathKey]=$this->fileProcess($filePath,'makeFile'); |
113 | - } |
|
114 | - else{ |
|
112 | + } else{ |
|
115 | 113 | $results['file'][$pathKey]= $this->getResult(false, |
116 | 114 | 'Already exist the specified file'); |
117 | 115 | } |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | */ |
47 | 47 | private function getPaths($params) |
48 | 48 | { |
49 | - if(!isset($params[0]['group'])){ |
|
49 | + if (!isset($params[0]['group'])) { |
|
50 | 50 | return [$this->config['paths'][0]]; |
51 | 51 | } |
52 | 52 | |
@@ -59,15 +59,15 @@ discard block |
||
59 | 59 | * @param $params |
60 | 60 | * @return bool |
61 | 61 | */ |
62 | - private function fopenprocess($executionPath,$path,$params) |
|
62 | + private function fopenprocess($executionPath, $path, $params) |
|
63 | 63 | { |
64 | 64 | $dt = fopen($executionPath, "r"); |
65 | 65 | $content = fread($dt, filesize($executionPath)); |
66 | 66 | fclose($dt); |
67 | 67 | |
68 | - foreach ($params as $key=>$value){ |
|
68 | + foreach ($params as $key=>$value) { |
|
69 | 69 | |
70 | - $content=str_replace("__".$key."__",$value,$content); |
|
70 | + $content = str_replace("__".$key."__", $value, $content); |
|
71 | 71 | } |
72 | 72 | |
73 | 73 | |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | */ |
87 | 87 | public function get($params) |
88 | 88 | { |
89 | - list($arguments,$type) = $params; |
|
89 | + list($arguments, $type) = $params; |
|
90 | 90 | |
91 | 91 | $table = $arguments['table']; |
92 | 92 | $name = $arguments['name']; |
@@ -95,22 +95,22 @@ discard block |
||
95 | 95 | |
96 | 96 | $paths = $this->getPaths($params); |
97 | 97 | |
98 | - foreach ($paths as $pathKey=>$path){ |
|
98 | + foreach ($paths as $pathKey=>$path) { |
|
99 | 99 | |
100 | 100 | $tableDirectory = $path.'/'.ucfirst($table); |
101 | 101 | |
102 | 102 | |
103 | - if(!file_exists($tableDirectory)){ |
|
104 | - $results['directory'][$pathKey]= $this->fileProcess($tableDirectory,'makeDirectory'); |
|
103 | + if (!file_exists($tableDirectory)) { |
|
104 | + $results['directory'][$pathKey] = $this->fileProcess($tableDirectory, 'makeDirectory'); |
|
105 | 105 | } |
106 | - else{ |
|
107 | - $results['directory'][$pathKey]= $this->getResult(false, |
|
106 | + else { |
|
107 | + $results['directory'][$pathKey] = $this->getResult(false, |
|
108 | 108 | 'Already exist the specified directory'); |
109 | 109 | } |
110 | 110 | |
111 | - $results['directory'][$pathKey]['table']= $table; |
|
112 | - $results['directory'][$pathKey]['directory']= $table; |
|
113 | - $results['directory'][$pathKey]['type']= $type; |
|
111 | + $results['directory'][$pathKey]['table'] = $table; |
|
112 | + $results['directory'][$pathKey]['directory'] = $table; |
|
113 | + $results['directory'][$pathKey]['type'] = $type; |
|
114 | 114 | |
115 | 115 | $fileName = ucfirst($name); |
116 | 116 | |
@@ -118,23 +118,23 @@ discard block |
||
118 | 118 | |
119 | 119 | $filePath = $tableDirectory.'/'.$fileNameWithTime.'.php'; |
120 | 120 | |
121 | - if(!file_exists($filePath)){ |
|
122 | - $results['file'][$pathKey]=$this->fileProcess($filePath,'makeFile'); |
|
121 | + if (!file_exists($filePath)) { |
|
122 | + $results['file'][$pathKey] = $this->fileProcess($filePath, 'makeFile'); |
|
123 | 123 | } |
124 | - else{ |
|
125 | - $results['file'][$pathKey]= $this->getResult(false, |
|
124 | + else { |
|
125 | + $results['file'][$pathKey] = $this->getResult(false, |
|
126 | 126 | 'Already exist the specified file'); |
127 | 127 | } |
128 | 128 | |
129 | - $results['file'][$pathKey]['table']=$table; |
|
130 | - $results['file'][$pathKey]['file']=$fileName; |
|
131 | - $results['file'][$pathKey]['type']=$type; |
|
129 | + $results['file'][$pathKey]['table'] = $table; |
|
130 | + $results['file'][$pathKey]['file'] = $fileName; |
|
131 | + $results['file'][$pathKey]['type'] = $type; |
|
132 | 132 | |
133 | 133 | $stubber = $this->stubber.'/'.$type.'.stub'; |
134 | 134 | |
135 | - $this->fopenprocess($stubber,$filePath,['className'=>$fileName]); |
|
135 | + $this->fopenprocess($stubber, $filePath, ['className'=>$fileName]); |
|
136 | 136 | |
137 | - $this->file->chmod($tableDirectory,0777,000,true); |
|
137 | + $this->file->chmod($tableDirectory, 0777, 000, true); |
|
138 | 138 | } |
139 | 139 | |
140 | 140 | return $results; |
@@ -145,11 +145,11 @@ discard block |
||
145 | 145 | * @param $process |
146 | 146 | * @return array |
147 | 147 | */ |
148 | - private function fileProcess($path,$process) |
|
148 | + private function fileProcess($path, $process) |
|
149 | 149 | { |
150 | 150 | try { |
151 | 151 | $this->{$process}($path); |
152 | - return $this->getResult(true,null); |
|
152 | + return $this->getResult(true, null); |
|
153 | 153 | } catch (IOExceptionInterface $exception) { |
154 | 154 | return $this->getResult(false, |
155 | 155 | "An error occurred while creating your directory at ".$exception->getPath().""); |
@@ -160,9 +160,9 @@ discard block |
||
160 | 160 | * @param $path |
161 | 161 | * @param int $mode |
162 | 162 | */ |
163 | - private function makeDirectory($path,$mode=0777) |
|
163 | + private function makeDirectory($path, $mode = 0777) |
|
164 | 164 | { |
165 | - return $this->file->mkdir($path,$mode); |
|
165 | + return $this->file->mkdir($path, $mode); |
|
166 | 166 | } |
167 | 167 | |
168 | 168 | /** |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | * @param $message |
179 | 179 | * @return array |
180 | 180 | */ |
181 | - private function getResult($success,$message) |
|
181 | + private function getResult($success, $message) |
|
182 | 182 | { |
183 | 183 | return [ |
184 | 184 | 'success'=>$success, |
@@ -13,6 +13,6 @@ |
||
13 | 13 | * @param array $tables |
14 | 14 | * @return mixed |
15 | 15 | */ |
16 | - public function getColumns($tables=array()); |
|
16 | + public function getColumns($tables = array()); |
|
17 | 17 | |
18 | 18 | } |
19 | 19 | \ No newline at end of file |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | * @param bool $table |
17 | 17 | * @return TablePropertiesContract |
18 | 18 | */ |
19 | - public function collation($value,$table=false); |
|
19 | + public function collation($value, $table = false); |
|
20 | 20 | |
21 | 21 | /** |
22 | 22 | * @param $value |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | * @param bool $key |
37 | 37 | * @return $this |
38 | 38 | */ |
39 | - public function index($name=null,$value=null,$key=false); |
|
39 | + public function index($name = null, $value = null, $key = false); |
|
40 | 40 | |
41 | 41 | /** |
42 | 42 | * @param $value |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | * @param bool $null |
49 | 49 | * @return $this |
50 | 50 | */ |
51 | - public function nullable($null=true); |
|
51 | + public function nullable($null = true); |
|
52 | 52 | |
53 | 53 | /** |
54 | 54 | * @return $this |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | * @param null $value |
66 | 66 | * @return mixed |
67 | 67 | */ |
68 | - public function unique($name=null,$value=null); |
|
68 | + public function unique($name = null, $value = null); |
|
69 | 69 | |
70 | 70 | } |
71 | 71 |
@@ -9,6 +9,6 @@ |
||
9 | 9 | * @param string $field |
10 | 10 | * @return OptionsContract |
11 | 11 | */ |
12 | - public function references($table,$field='id'); |
|
12 | + public function references($table, $field = 'id'); |
|
13 | 13 | } |
14 | 14 |
@@ -13,7 +13,7 @@ |
||
13 | 13 | * @param array $tables |
14 | 14 | * @return mixed |
15 | 15 | */ |
16 | - public function fields($tables=array()); |
|
16 | + public function fields($tables = array()); |
|
17 | 17 | |
18 | 18 | } |
19 | 19 |