@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | $data['plural'] = plural($data['name']); |
| 45 | 45 | $data['singular'] = singular($data['name']); |
| 46 | 46 | |
| 47 | - $primaryKey = 'get_' . $this->describe->getPrimaryKey($data['name']); |
|
| 47 | + $primaryKey = 'get_'.$this->describe->getPrimaryKey($data['name']); |
|
| 48 | 48 | $data['primaryKey'] = $primaryKey; |
| 49 | 49 | |
| 50 | 50 | if ($this->data['isCamel']) { |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | |
| 86 | 86 | $this->data['foreignKeys'][$field] = plural($referencedTable); |
| 87 | 87 | |
| 88 | - $singular = $field . '_singular'; |
|
| 88 | + $singular = $field.'_singular'; |
|
| 89 | 89 | |
| 90 | 90 | $this->data['foreignKeys'][$singular] = singular( |
| 91 | 91 | $referencedTable |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | */ |
| 43 | 43 | protected function getPrimaryKey(array $data, $field, $referencedTable) |
| 44 | 44 | { |
| 45 | - $accessor = 'get_' . $this->describe->getPrimaryKey($referencedTable); |
|
| 45 | + $accessor = 'get_'.$this->describe->getPrimaryKey($referencedTable); |
|
| 46 | 46 | |
| 47 | 47 | $data['primaryKeys'][$field] = $accessor; |
| 48 | 48 | |
@@ -67,15 +67,15 @@ discard block |
||
| 67 | 67 | if ($type == 'camelize') { |
| 68 | 68 | return [ |
| 69 | 69 | 'field' => lcfirst(camelize($field)), |
| 70 | - 'accessor' => lcfirst(camelize('get_' . $field)), |
|
| 71 | - 'mutator' => lcfirst(camelize('set_' . $field)) |
|
| 70 | + 'accessor' => lcfirst(camelize('get_'.$field)), |
|
| 71 | + 'mutator' => lcfirst(camelize('set_'.$field)) |
|
| 72 | 72 | ]; |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | return [ |
| 76 | 76 | 'field' => lcfirst(underscore($field)), |
| 77 | - 'accessor' => lcfirst(underscore('get_' . $field)), |
|
| 78 | - 'mutator' => lcfirst(underscore('set_' . $field)) |
|
| 77 | + 'accessor' => lcfirst(underscore('get_'.$field)), |
|
| 78 | + 'mutator' => lcfirst(underscore('set_'.$field)) |
|
| 79 | 79 | ]; |
| 80 | 80 | } |
| 81 | 81 | } |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | */ |
| 35 | 35 | public function isEnabled() |
| 36 | 36 | { |
| 37 | - $file = APPPATH . 'libraries/' . $this->library . '.php'; |
|
| 37 | + $file = APPPATH.'libraries/'.$this->library.'.php'; |
|
| 38 | 38 | |
| 39 | 39 | return file_exists($file); |
| 40 | 40 | } |
@@ -47,8 +47,8 @@ discard block |
||
| 47 | 47 | protected function configure() |
| 48 | 48 | { |
| 49 | 49 | $this |
| 50 | - ->setName('remove:' . $this->library) |
|
| 51 | - ->setDescription('Removes ' . ucfirst($this->library)); |
|
| 50 | + ->setName('remove:'.$this->library) |
|
| 51 | + ->setDescription('Removes '.ucfirst($this->library)); |
|
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | /** |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | */ |
| 61 | 61 | protected function execute(InputInterface $input, OutputInterface $output) |
| 62 | 62 | { |
| 63 | - $autoload = new Config('autoload', APPPATH . 'config'); |
|
| 63 | + $autoload = new Config('autoload', APPPATH.'config'); |
|
| 64 | 64 | |
| 65 | 65 | $libraries = $autoload->get('libraries', 60, 'array'); |
| 66 | 66 | |
@@ -77,10 +77,10 @@ discard block |
||
| 77 | 77 | system('composer remove doctrine/orm'); |
| 78 | 78 | } |
| 79 | 79 | |
| 80 | - unlink(APPPATH . 'libraries/' . ucfirst($this->library) . '.php'); |
|
| 80 | + unlink(APPPATH.'libraries/'.ucfirst($this->library).'.php'); |
|
| 81 | 81 | |
| 82 | - $message = ucfirst($this->library) . ' is now successfully removed!'; |
|
| 82 | + $message = ucfirst($this->library).' is now successfully removed!'; |
|
| 83 | 83 | |
| 84 | - return $output->writeln('<info>' . $message . '</info>'); |
|
| 84 | + return $output->writeln('<info>'.$message.'</info>'); |
|
| 85 | 85 | } |
| 86 | 86 | } |
@@ -54,8 +54,8 @@ |
||
| 54 | 54 | */ |
| 55 | 55 | protected function configure() |
| 56 | 56 | { |
| 57 | - $this->setName('create:' . $this->command) |
|
| 58 | - ->setDescription('Create a new ' . $this->command) |
|
| 57 | + $this->setName('create:'.$this->command) |
|
| 58 | + ->setDescription('Create a new '.$this->command) |
|
| 59 | 59 | ->addArgument( |
| 60 | 60 | 'name', |
| 61 | 61 | InputArgument::REQUIRED, |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | $field = strtolower($column->getField()); |
| 54 | - $method = 'set_' . $field; |
|
| 54 | + $method = 'set_'.$field; |
|
| 55 | 55 | |
| 56 | 56 | $this->data['camel'][$field] = lcfirst(camelize($method)); |
| 57 | 57 | $this->data['underscore'][$field] = underscore($method); |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | 'field' => $field |
| 74 | 74 | ]; |
| 75 | 75 | |
| 76 | - if (! in_array($field, $columnFields)) { |
|
| 76 | + if ( ! in_array($field, $columnFields)) { |
|
| 77 | 77 | $field = $this->describe->getPrimaryKey($referencedTable); |
| 78 | 78 | |
| 79 | 79 | $dropdown['field'] = $field; |
@@ -19,8 +19,8 @@ discard block |
||
| 19 | 19 | */ |
| 20 | 20 | public static function hasLayout() |
| 21 | 21 | { |
| 22 | - $header = APPPATH . 'views/layout/header.php'; |
|
| 23 | - $footer = APPPATH . 'views/layout/footer.php'; |
|
| 22 | + $header = APPPATH.'views/layout/header.php'; |
|
| 23 | + $footer = APPPATH.'views/layout/footer.php'; |
|
| 24 | 24 | |
| 25 | 25 | return file_exists($header) && file_exists($footer); |
| 26 | 26 | } |
@@ -33,8 +33,8 @@ discard block |
||
| 33 | 33 | public static function ignite() |
| 34 | 34 | { |
| 35 | 35 | $autoloadPath = 'realpath(\'vendor\') . \'/autoload.php\''; |
| 36 | - $configPath = APPPATH . 'config'; |
|
| 37 | - $templatePath = __DIR__ . '/../Templates'; |
|
| 36 | + $configPath = APPPATH.'config'; |
|
| 37 | + $templatePath = __DIR__.'/../Templates'; |
|
| 38 | 38 | |
| 39 | 39 | // Gets data from application/config/config.php |
| 40 | 40 | $config = new Config('config', $configPath); |
@@ -52,16 +52,16 @@ discard block |
||
| 52 | 52 | $drivers = $autoload->get('drivers', 81, 'array'); |
| 53 | 53 | |
| 54 | 54 | // Includes "session" driver. |
| 55 | - if (! in_array('session', $drivers)) { |
|
| 55 | + if ( ! in_array('session', $drivers)) { |
|
| 56 | 56 | array_push($drivers, 'session'); |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | // Gets the currently included helpers |
| 60 | - $defaultHelpers = [ 'form', 'url' ]; |
|
| 60 | + $defaultHelpers = ['form', 'url']; |
|
| 61 | 61 | $helpers = $autoload->get('helper', 91, 'array'); |
| 62 | 62 | |
| 63 | 63 | foreach ($defaultHelpers as $helper) { |
| 64 | - if (! in_array($helper, $helpers)) { |
|
| 64 | + if ( ! in_array($helper, $helpers)) { |
|
| 65 | 65 | array_push($helpers, $helper); |
| 66 | 66 | } |
| 67 | 67 | } |
@@ -77,14 +77,14 @@ discard block |
||
| 77 | 77 | 'name' => 'Htaccess' |
| 78 | 78 | ], |
| 79 | 79 | [ |
| 80 | - 'file' => APPPATH . 'config/pagination.php', |
|
| 80 | + 'file' => APPPATH.'config/pagination.php', |
|
| 81 | 81 | 'name' => 'Pagination' |
| 82 | 82 | ] |
| 83 | 83 | ]; |
| 84 | 84 | |
| 85 | 85 | foreach ($templates as $template) { |
| 86 | 86 | $file = new File($template['file']); |
| 87 | - $path = $templatePath . '/' . $template['name'] . '.tpl'; |
|
| 87 | + $path = $templatePath.'/'.$template['name'].'.tpl'; |
|
| 88 | 88 | |
| 89 | 89 | if ($template['file'] == '.htaccess') { |
| 90 | 90 | $file->chmod(0777); |
@@ -102,8 +102,8 @@ discard block |
||
| 102 | 102 | */ |
| 103 | 103 | public static function isCommandEnabled() |
| 104 | 104 | { |
| 105 | - $doctrine = APPPATH . 'libraries/Doctrine.php'; |
|
| 106 | - $wildfire = APPPATH . 'libraries/Wildfire.php'; |
|
| 105 | + $doctrine = APPPATH.'libraries/Doctrine.php'; |
|
| 106 | + $wildfire = APPPATH.'libraries/Wildfire.php'; |
|
| 107 | 107 | |
| 108 | 108 | return file_exists($doctrine) || file_exists($wildfire); |
| 109 | 109 | } |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | { |
| 34 | 34 | $library = ($this->library == 'doctrine') ? 'Wildfire' : 'Doctrine'; |
| 35 | 35 | |
| 36 | - return ! file_exists(APPPATH . 'libraries/' . $library . '.php'); |
|
| 36 | + return ! file_exists(APPPATH.'libraries/'.$library.'.php'); |
|
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | /** |
@@ -44,8 +44,8 @@ discard block |
||
| 44 | 44 | protected function configure() |
| 45 | 45 | { |
| 46 | 46 | $this |
| 47 | - ->setName('install:' . $this->library) |
|
| 48 | - ->setDescription('Installs ' . ucfirst($this->library)); |
|
| 47 | + ->setName('install:'.$this->library) |
|
| 48 | + ->setDescription('Installs '.ucfirst($this->library)); |
|
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | /** |
@@ -56,11 +56,11 @@ discard block |
||
| 56 | 56 | */ |
| 57 | 57 | protected function addLibrary($library) |
| 58 | 58 | { |
| 59 | - $autoload = new Config('autoload', APPPATH . 'config'); |
|
| 59 | + $autoload = new Config('autoload', APPPATH.'config'); |
|
| 60 | 60 | |
| 61 | 61 | $libraries = $autoload->get('libraries', 60, 'array'); |
| 62 | 62 | |
| 63 | - if (! in_array($library, $libraries)) { |
|
| 63 | + if ( ! in_array($library, $libraries)) { |
|
| 64 | 64 | array_push($libraries, $library); |
| 65 | 65 | |
| 66 | 66 | $autoload->set('libraries', 60, $libraries, 'array'); |
@@ -49,10 +49,10 @@ discard block |
||
| 49 | 49 | */ |
| 50 | 50 | public function fails() |
| 51 | 51 | { |
| 52 | - $hasDoctrine = file_exists(APPPATH . 'libraries/Doctrine.php'); |
|
| 53 | - $hasWildfire = file_exists(APPPATH . 'libraries/Wildfire.php'); |
|
| 52 | + $hasDoctrine = file_exists(APPPATH.'libraries/Doctrine.php'); |
|
| 53 | + $hasWildfire = file_exists(APPPATH.'libraries/Wildfire.php'); |
|
| 54 | 54 | |
| 55 | - if (! $hasWildfire && ! $hasDoctrine) { |
|
| 55 | + if ( ! $hasWildfire && ! $hasDoctrine) { |
|
| 56 | 56 | $this->message = 'Please install Wildfire or Doctrine!'; |
| 57 | 57 | |
| 58 | 58 | return true; |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | $name = $this->file['name']; |
| 75 | 75 | $type = $this->file['type']; |
| 76 | 76 | |
| 77 | - $this->message = 'The "' . $name . '" ' . $type . ' already exists!'; |
|
| 77 | + $this->message = 'The "'.$name.'" '.$type.' already exists!'; |
|
| 78 | 78 | |
| 79 | 79 | return true; |
| 80 | 80 | } |
@@ -37,10 +37,10 @@ |
||
| 37 | 37 | */ |
| 38 | 38 | public function fails() |
| 39 | 39 | { |
| 40 | - $filePath = APPPATH . 'views/' . $this->name; |
|
| 40 | + $filePath = APPPATH.'views/'.$this->name; |
|
| 41 | 41 | |
| 42 | - if (! @mkdir($filePath, 0775, true)) { |
|
| 43 | - $this->message = 'The "' . $this->name . '" views folder already exists!'; |
|
| 42 | + if ( ! @mkdir($filePath, 0775, true)) { |
|
| 43 | + $this->message = 'The "'.$this->name.'" views folder already exists!'; |
|
| 44 | 44 | |
| 45 | 45 | return true; |
| 46 | 46 | } |