@@ -22,7 +22,7 @@ |
||
| 22 | 22 | 'migration <classname> Generate migration file skeleton', |
| 23 | 23 | ]); |
| 24 | 24 | $this->setDescr( |
| 25 | - '<<bold>>generate<<reset>> command generates code.' . PHP_EOL |
|
| 25 | + '<<bold>>generate<<reset>> command generates code.'.PHP_EOL |
|
| 26 | 26 | . ' eg, generate migration Create_user_table' |
| 27 | 27 | ); |
| 28 | 28 | } |
@@ -37,13 +37,13 @@ |
||
| 37 | 37 | |
| 38 | 38 | public function __get($property) |
| 39 | 39 | { |
| 40 | - if (! property_exists($this->ci, $property)) { |
|
| 40 | + if (!property_exists($this->ci, $property)) { |
|
| 41 | 41 | ob_start(); |
| 42 | 42 | var_dump(debug_backtrace()); |
| 43 | 43 | $backtrace = ob_get_clean(); |
| 44 | - file_put_contents(ROOTPATH . '/tmp/backtrace.log', $backtrace, LOCK_EX); |
|
| 44 | + file_put_contents(ROOTPATH.'/tmp/backtrace.log', $backtrace, LOCK_EX); |
|
| 45 | 45 | $this->stdio->errln( |
| 46 | - '<<red>>No such property: ' . $property . ' in CodeIgniter instance<<reset>>' |
|
| 46 | + '<<red>>No such property: '.$property.' in CodeIgniter instance<<reset>>' |
|
| 47 | 47 | ); |
| 48 | 48 | $this->stdio->errln('Backtrace was saved in tmp/backtrace.log'); |
| 49 | 49 | throw new RuntimeException('Property does not exist'); |
@@ -37,8 +37,8 @@ discard block |
||
| 37 | 37 | */ |
| 38 | 38 | public function __invoke($class = null) |
| 39 | 39 | { |
| 40 | - $options =[ |
|
| 41 | - 'l', // short flag -l, parameter is not allowed |
|
| 40 | + $options = [ |
|
| 41 | + 'l', // short flag -l, parameter is not allowed |
|
| 42 | 42 | 'list', // long option --list, parameter is not allowed |
| 43 | 43 | ]; |
| 44 | 44 | $getopt = $this->context->getopt($options); |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | if ($class === null) { |
| 53 | 53 | $seeder_list = $this->findSeeder(); |
| 54 | 54 | } else { |
| 55 | - $seeder_list = [$this->seeder_path . $class . '.php']; |
|
| 55 | + $seeder_list = [$this->seeder_path.$class.'.php']; |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | $this->runSeederList($seeder_list); |
@@ -65,30 +65,30 @@ discard block |
||
| 65 | 65 | */ |
| 66 | 66 | public function call($class) |
| 67 | 67 | { |
| 68 | - $seeder_list = [$this->seeder_path . $class . '.php']; |
|
| 68 | + $seeder_list = [$this->seeder_path.$class.'.php']; |
|
| 69 | 69 | $this->runSeederList($seeder_list); |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | private function runSeederList($seeder_list) |
| 73 | 73 | { |
| 74 | 74 | foreach ($seeder_list as $file) { |
| 75 | - if (! is_readable($file)) { |
|
| 76 | - $this->stdio->errln('<<red>>Can\'t read: ' . $file . '<<reset>>'); |
|
| 75 | + if (!is_readable($file)) { |
|
| 76 | + $this->stdio->errln('<<red>>Can\'t read: '.$file.'<<reset>>'); |
|
| 77 | 77 | break; |
| 78 | 78 | } |
| 79 | 79 | require_once $file; |
| 80 | 80 | $classname = basename($file, '.php'); |
| 81 | - if (! class_exists($classname)) { |
|
| 81 | + if (!class_exists($classname)) { |
|
| 82 | 82 | $this->stdio->errln( |
| 83 | - '<<red>>No such class: ' . $classname . ' in ' . $file . '<<reset>>' |
|
| 84 | - . ' [' . __METHOD__ . ': line ' . __LINE__ . ']' |
|
| 83 | + '<<red>>No such class: '.$classname.' in '.$file.'<<reset>>' |
|
| 84 | + . ' ['.__METHOD__.': line '.__LINE__.']' |
|
| 85 | 85 | ); |
| 86 | 86 | break; |
| 87 | 87 | } |
| 88 | 88 | $seeder = new $classname($this->context, $this->stdio, $this->ci); |
| 89 | 89 | $seeder->setSeederPath($this->seeder_path); |
| 90 | 90 | $this->runSeed($seeder); |
| 91 | - $this->stdio->outln('<<green>>Seeded: ' . $classname . '<<reset>>'); |
|
| 91 | + $this->stdio->outln('<<green>>Seeded: '.$classname.'<<reset>>'); |
|
| 92 | 92 | } |
| 93 | 93 | } |
| 94 | 94 | |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | $seeder_list = $this->findSeeder(); |
| 98 | 98 | foreach ($seeder_list as $file) { |
| 99 | 99 | if (is_readable($file)) { |
| 100 | - $this->stdio->outln(' <<green>>' . $file . '<<reset>>'); |
|
| 100 | + $this->stdio->outln(' <<green>>'.$file.'<<reset>>'); |
|
| 101 | 101 | } |
| 102 | 102 | } |
| 103 | 103 | } |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | private function findSeeder() |
| 111 | 111 | { |
| 112 | 112 | $seeders = []; |
| 113 | - foreach (glob($this->seeder_path . '*.php') as $file) { |
|
| 113 | + foreach (glob($this->seeder_path.'*.php') as $file) { |
|
| 114 | 114 | $seeders[] = $file; |
| 115 | 115 | } |
| 116 | 116 | return $seeders; |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | public static function registerCommandClasses(Container $di, $ci, array $paths) |
| 18 | 18 | { |
| 19 | 19 | foreach ($paths as $path) { |
| 20 | - foreach (glob($path . '*Command.php') as $file) { |
|
| 20 | + foreach (glob($path.'*Command.php') as $file) { |
|
| 21 | 21 | $classname = static::findClass($di, $file); |
| 22 | 22 | if ($classname === '') { |
| 23 | 23 | break; |
@@ -40,10 +40,10 @@ discard block |
||
| 40 | 40 | { |
| 41 | 41 | require_once $file; |
| 42 | 42 | $classname = basename($file, '.php'); |
| 43 | - if (! class_exists($classname)) { |
|
| 43 | + if (!class_exists($classname)) { |
|
| 44 | 44 | $stdio = $di->get('aura/cli-kernel:stdio'); |
| 45 | 45 | $stdio->errln( |
| 46 | - '<<red>>No such class: ' . $classname . ' in ' . $file . '<<reset>>' |
|
| 46 | + '<<red>>No such class: '.$classname.' in '.$file.'<<reset>>' |
|
| 47 | 47 | ); |
| 48 | 48 | return ''; |
| 49 | 49 | } |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | ) |
| 56 | 56 | { |
| 57 | 57 | foreach ($paths as $path) { |
| 58 | - foreach (glob($path . '*Command.php') as $file) { |
|
| 58 | + foreach (glob($path.'*Command.php') as $file) { |
|
| 59 | 59 | $classname = static::findClass($di, $file); |
| 60 | 60 | if ($classname === '') { |
| 61 | 61 | break; |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | ); |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | - foreach (glob($path . '*CommandHelp.php') as $file) { |
|
| 71 | + foreach (glob($path.'*CommandHelp.php') as $file) { |
|
| 72 | 72 | $classname = static::findClass($di, $file); |
| 73 | 73 | if ($classname === '') { |
| 74 | 74 | break; |