@@ -1,22 +1,22 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -if ( ! ini_get ( 'short_open_tag' ) ) |
|
| 3 | +if ( ! ini_get('short_open_tag')) |
|
| 4 | 4 | { |
| 5 | - die( "please enable short_open_tag directive in php.ini\n" ); |
|
| 5 | + die("please enable short_open_tag directive in php.ini\n"); |
|
| 6 | 6 | } |
| 7 | 7 | |
| 8 | -if ( ! ini_get ( 'register_argc_argv' ) ) |
|
| 8 | +if ( ! ini_get('register_argc_argv')) |
|
| 9 | 9 | { |
| 10 | - die( "please enable register_argc_argv directive in php.ini\n" ); |
|
| 10 | + die("please enable register_argc_argv directive in php.ini\n"); |
|
| 11 | 11 | } |
| 12 | 12 | |
| 13 | 13 | if (function_exists('ini_set')) { |
| 14 | 14 | @ini_set('display_errors', 1); |
| 15 | 15 | |
| 16 | - $memoryInBytes = function ($value) { |
|
| 16 | + $memoryInBytes = function($value) { |
|
| 17 | 17 | $unit = strtolower(substr($value, -1, 1)); |
| 18 | 18 | $value = (int) $value; |
| 19 | - switch($unit) { |
|
| 19 | + switch ($unit) { |
|
| 20 | 20 | case 'g': |
| 21 | 21 | $value *= 1024; |
| 22 | 22 | // no break (cumulative multiplier) |
@@ -38,14 +38,14 @@ discard block |
||
| 38 | 38 | unset($memoryInBytes, $memoryLimit); |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | -\Phar::interceptFileFuncs (); |
|
| 41 | +\Phar::interceptFileFuncs(); |
|
| 42 | 42 | |
| 43 | -set_include_path ( |
|
| 44 | - implode ( |
|
| 45 | - PATH_SEPARATOR , |
|
| 46 | - array ( |
|
| 47 | - realpath ( __DIR__ ) , |
|
| 48 | - get_include_path () , |
|
| 43 | +set_include_path( |
|
| 44 | + implode( |
|
| 45 | + PATH_SEPARATOR, |
|
| 46 | + array( |
|
| 47 | + realpath(__DIR__), |
|
| 48 | + get_include_path(), |
|
| 49 | 49 | ) |
| 50 | 50 | ) |
| 51 | 51 | ); |
@@ -56,43 +56,43 @@ discard block |
||
| 56 | 56 | |
| 57 | 57 | try |
| 58 | 58 | { |
| 59 | - $_path = realpath ( |
|
| 60 | - str_replace ( |
|
| 59 | + $_path = realpath( |
|
| 60 | + str_replace( |
|
| 61 | 61 | 'phar://' |
| 62 | - , '' , __DIR__ |
|
| 62 | + , '', __DIR__ |
|
| 63 | 63 | ) |
| 64 | 64 | ); |
| 65 | 65 | |
| 66 | - $arrValid = array ( |
|
| 67 | - 'version' , |
|
| 68 | - 'help' , |
|
| 69 | - 'status' , |
|
| 70 | - 'init' , |
|
| 71 | - 'config-env:' , |
|
| 72 | - 'config-ini:' , |
|
| 73 | - 'database:' , |
|
| 74 | - 'schema:' , |
|
| 75 | - 'driver:' , |
|
| 76 | - 'framework:' , |
|
| 66 | + $arrValid = array( |
|
| 67 | + 'version', |
|
| 68 | + 'help', |
|
| 69 | + 'status', |
|
| 70 | + 'init', |
|
| 71 | + 'config-env:', |
|
| 72 | + 'config-ini:', |
|
| 73 | + 'database:', |
|
| 74 | + 'schema:', |
|
| 75 | + 'driver:', |
|
| 76 | + 'framework:', |
|
| 77 | 77 | 'path:' |
| 78 | 78 | ); |
| 79 | 79 | |
| 80 | - $argv = getopt ( null, $arrValid ); |
|
| 80 | + $argv = getopt(null, $arrValid); |
|
| 81 | 81 | |
| 82 | - if ( array_key_exists ( 'init', $argv ) ) |
|
| 82 | + if (array_key_exists('init', $argv)) |
|
| 83 | 83 | { |
| 84 | - $maker = new \Classes\MakerConfigFile( $argv, $_path ); |
|
| 84 | + $maker = new \Classes\MakerConfigFile($argv, $_path); |
|
| 85 | 85 | } |
| 86 | 86 | else |
| 87 | 87 | { |
| 88 | - $maker = new \Classes\MakerFile( new \Classes\Config( $argv, $_path ) ); |
|
| 88 | + $maker = new \Classes\MakerFile(new \Classes\Config($argv, $_path)); |
|
| 89 | 89 | } |
| 90 | 90 | |
| 91 | - $maker->run (); |
|
| 91 | + $maker->run(); |
|
| 92 | 92 | |
| 93 | -} catch ( \Exception $e ) |
|
| 93 | +} catch (\Exception $e) |
|
| 94 | 94 | { |
| 95 | - die( $e->getMessage () ); |
|
| 95 | + die($e->getMessage()); |
|
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | __halt_compiler(); |
| 99 | 99 | \ No newline at end of file |
@@ -24,21 +24,21 @@ discard block |
||
| 24 | 24 | |
| 25 | 25 | private $msg = "\033[0mPlease enter the value for %index% \033[1;33m[%config%]:\033[0m "; |
| 26 | 26 | |
| 27 | - private $configs = array ( |
|
| 28 | - 'config-env' => 'config' , |
|
| 29 | - 'framework' => 'none' , |
|
| 30 | - 'driver' => 'pgsql' , |
|
| 31 | - 'environment' => 'dev' , |
|
| 32 | - 'host' => 'localhost' , |
|
| 33 | - 'database' => null , |
|
| 34 | - 'schema' => null , |
|
| 35 | - 'username' => null , |
|
| 27 | + private $configs = array( |
|
| 28 | + 'config-env' => 'config', |
|
| 29 | + 'framework' => 'none', |
|
| 30 | + 'driver' => 'pgsql', |
|
| 31 | + 'environment' => 'dev', |
|
| 32 | + 'host' => 'localhost', |
|
| 33 | + 'database' => null, |
|
| 34 | + 'schema' => null, |
|
| 35 | + 'username' => null, |
|
| 36 | 36 | 'password' => null |
| 37 | 37 | ); |
| 38 | 38 | |
| 39 | - public function __construct ( $argv , $basePath ) |
|
| 39 | + public function __construct($argv, $basePath) |
|
| 40 | 40 | { |
| 41 | - $this->argv = $this->parseConfig ( $basePath , $argv ); |
|
| 41 | + $this->argv = $this->parseConfig($basePath, $argv); |
|
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | /** |
@@ -50,32 +50,32 @@ discard block |
||
| 50 | 50 | * @return array |
| 51 | 51 | * @throws \Exception |
| 52 | 52 | */ |
| 53 | - private function parseConfig ( $basePath , $argv ) |
|
| 53 | + private function parseConfig($basePath, $argv) |
|
| 54 | 54 | { |
| 55 | - $this->baseLocation = dirname ( $basePath ); |
|
| 55 | + $this->baseLocation = dirname($basePath); |
|
| 56 | 56 | |
| 57 | - $arrayIO = array_diff_key ( $this->configs , $argv ); |
|
| 58 | - foreach ( $arrayIO as $index => $config ) |
|
| 57 | + $arrayIO = array_diff_key($this->configs, $argv); |
|
| 58 | + foreach ($arrayIO as $index => $config) |
|
| 59 | 59 | { |
| 60 | - $attribs = array ( "%index%" => $index , "%config%" => $config ); |
|
| 61 | - echo strtr ( $this->msg , $attribs ); |
|
| 62 | - $line = trim ( fgets ( STDIN ) ); |
|
| 63 | - if ( ! empty( $line ) ) |
|
| 60 | + $attribs = array("%index%" => $index, "%config%" => $config); |
|
| 61 | + echo strtr($this->msg, $attribs); |
|
| 62 | + $line = trim(fgets(STDIN)); |
|
| 63 | + if ( ! empty($line)) |
|
| 64 | 64 | { |
| 65 | - $this->configs[ $index ] = strtolower ( $line ); |
|
| 65 | + $this->configs[$index] = strtolower($line); |
|
| 66 | 66 | } |
| 67 | 67 | } |
| 68 | - $this->configs ['version'] = Config::$version; |
|
| 69 | - return $argv + array_filter ( $this->configs ); |
|
| 68 | + $this->configs ['version'] = Config::$version; |
|
| 69 | + return $argv + array_filter($this->configs); |
|
| 70 | 70 | } |
| 71 | 71 | |
| 72 | - public function run () |
|
| 72 | + public function run() |
|
| 73 | 73 | { |
| 74 | 74 | $path = $this->baseLocation . DIRECTORY_SEPARATOR . "configs"; |
| 75 | - self::makeDir ( $path ); |
|
| 76 | - self::makeSourcer ( |
|
| 77 | - $path . DIRECTORY_SEPARATOR . $this->argv[ 'config-env' ] . '.ini' , |
|
| 78 | - $this->getParsedTplContents ( $this->template , $this->argv ) |
|
| 75 | + self::makeDir($path); |
|
| 76 | + self::makeSourcer( |
|
| 77 | + $path . DIRECTORY_SEPARATOR . $this->argv['config-env'] . '.ini', |
|
| 78 | + $this->getParsedTplContents($this->template, $this->argv) |
|
| 79 | 79 | ); |
| 80 | 80 | echo "\n\033[1;32mSuccessfully process finished!\n\033[0m"; |
| 81 | 81 | } |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | * |
| 79 | 79 | * @return array[] |
| 80 | 80 | */ |
| 81 | - public function getListColumns () |
|
| 81 | + public function getListColumns() |
|
| 82 | 82 | { |
| 83 | 83 | // TODO: Implement getListColumns() method. |
| 84 | 84 | } |
@@ -88,17 +88,17 @@ discard block |
||
| 88 | 88 | * |
| 89 | 89 | * @return int |
| 90 | 90 | */ |
| 91 | - public function getTotalTables () |
|
| 91 | + public function getTotalTables() |
|
| 92 | 92 | { |
| 93 | 93 | // TODO: Implement totalTables() method. |
| 94 | 94 | } |
| 95 | 95 | |
| 96 | - public function getSequence ( $table , $column ) |
|
| 96 | + public function getSequence($table, $column) |
|
| 97 | 97 | { |
| 98 | 98 | // TODO: Implement getSequence() method. |
| 99 | 99 | } |
| 100 | 100 | |
| 101 | - public function getListConstrant () |
|
| 101 | + public function getListConstrant() |
|
| 102 | 102 | { |
| 103 | 103 | // TODO: Implement getListConstrant() method. |
| 104 | 104 | } |
@@ -17,7 +17,7 @@ |
||
| 17 | 17 | protected $parentFileTpl = ""; |
| 18 | 18 | protected $fileTpl = "model.php"; |
| 19 | 19 | |
| 20 | - public function parseRelation ( \Classes\MakerFile $makerFile, \Classes\Db\DbTable $dbTable ) |
|
| 20 | + public function parseRelation(\Classes\MakerFile $makerFile, \Classes\Db\DbTable $dbTable) |
|
| 21 | 21 | { |
| 22 | 22 | return array(); |
| 23 | 23 | } |
@@ -28,60 +28,60 @@ |
||
| 28 | 28 | * |
| 29 | 29 | * @return string[] |
| 30 | 30 | */ |
| 31 | - public function parseRelation ( \Classes\MakerFile $makerFile, \Classes\Db\DbTable $dbTable ) |
|
| 31 | + public function parseRelation(\Classes\MakerFile $makerFile, \Classes\Db\DbTable $dbTable) |
|
| 32 | 32 | { |
| 33 | 33 | $referenceMap = ''; |
| 34 | - $references = array (); |
|
| 34 | + $references = array(); |
|
| 35 | 35 | $dependentTables = ''; |
| 36 | - $dependents = array (); |
|
| 37 | - foreach ( $dbTable->getForeingkeys () as $fk ) |
|
| 36 | + $dependents = array(); |
|
| 37 | + foreach ($dbTable->getForeingkeys() as $fk) |
|
| 38 | 38 | { |
| 39 | - $constrant = $fk->getFks (); |
|
| 40 | - $references[] = sprintf ( |
|
| 39 | + $constrant = $fk->getFks(); |
|
| 40 | + $references[] = sprintf( |
|
| 41 | 41 | " |
| 42 | 42 | '%s' => array ( |
| 43 | 43 | 'columns' => '%s' , |
| 44 | 44 | 'refTableClass' => '%s', |
| 45 | 45 | 'refColumns' =>'%s' |
| 46 | 46 | )", |
| 47 | - AbstractMaker::getClassName ( $constrant->getNameConstrant () ), |
|
| 48 | - $fk->getName (), |
|
| 49 | - $makerFile->getConfig ()->createClassNamespace ( $constrant ) |
|
| 47 | + AbstractMaker::getClassName($constrant->getNameConstrant()), |
|
| 48 | + $fk->getName(), |
|
| 49 | + $makerFile->getConfig()->createClassNamespace($constrant) |
|
| 50 | 50 | . ZendFrameworkOne::SEPARETOR |
| 51 | 51 | . 'DbTable' |
| 52 | 52 | . ZendFrameworkOne::SEPARETOR |
| 53 | - . AbstractMaker::getClassName ( $constrant->getTable () ), |
|
| 54 | - $constrant->getColumn () |
|
| 53 | + . AbstractMaker::getClassName($constrant->getTable()), |
|
| 54 | + $constrant->getColumn() |
|
| 55 | 55 | |
| 56 | 56 | ); |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | - if ( sizeof ( $references ) > 0 ) |
|
| 59 | + if (sizeof($references) > 0) |
|
| 60 | 60 | { |
| 61 | 61 | $referenceMap = "protected \$_referenceMap = array(" . |
| 62 | - join ( ',', $references ) . "\n );"; |
|
| 62 | + join(',', $references) . "\n );"; |
|
| 63 | 63 | } |
| 64 | 64 | |
| 65 | - foreach ( $dbTable->getDependences () as $objColumn ) |
|
| 65 | + foreach ($dbTable->getDependences() as $objColumn) |
|
| 66 | 66 | { |
| 67 | - foreach ( $objColumn->getDependences () as $dependence ) |
|
| 67 | + foreach ($objColumn->getDependences() as $dependence) |
|
| 68 | 68 | { |
| 69 | - $dependents[] = $makerFile->getConfig ()->createClassNamespace ( $dependence ) |
|
| 69 | + $dependents[] = $makerFile->getConfig()->createClassNamespace($dependence) |
|
| 70 | 70 | . ZendFrameworkOne::SEPARETOR |
| 71 | 71 | . 'DbTable' |
| 72 | 72 | . ZendFrameworkOne::SEPARETOR |
| 73 | - . AbstractMaker::getClassName ( $dependence->getTable () ); |
|
| 73 | + . AbstractMaker::getClassName($dependence->getTable()); |
|
| 74 | 74 | } |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | - if ( sizeof ( $dependents ) > 0 ) |
|
| 77 | + if (sizeof($dependents) > 0) |
|
| 78 | 78 | { |
| 79 | 79 | $dependentTables = "protected \$_dependentTables = array(\n '" . |
| 80 | - join ( "',\n '", $dependents ) . "'\n );"; |
|
| 80 | + join("',\n '", $dependents) . "'\n );"; |
|
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | |
| 84 | - return array ( |
|
| 84 | + return array( |
|
| 85 | 85 | 'referenceMap' => $referenceMap, |
| 86 | 86 | 'dependentTables' => $dependentTables |
| 87 | 87 | ); |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | |
| 18 | 18 | const SEPARETOR = "_"; |
| 19 | 19 | |
| 20 | - protected function init () |
|
| 20 | + protected function init() |
|
| 21 | 21 | { |
| 22 | 22 | } |
| 23 | 23 | |
@@ -26,28 +26,28 @@ discard block |
||
| 26 | 26 | * |
| 27 | 27 | * @return array |
| 28 | 28 | */ |
| 29 | - protected function getParams () |
|
| 29 | + protected function getParams() |
|
| 30 | 30 | { |
| 31 | 31 | |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | - protected function parseFrameworkConfig () |
|
| 34 | + protected function parseFrameworkConfig() |
|
| 35 | 35 | { |
| 36 | 36 | // TODO: Implement parseFrameworkConfig() method. |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | - public function createClassNamespace ( $table ) |
|
| 39 | + public function createClassNamespace($table) |
|
| 40 | 40 | { |
| 41 | - $arrNames = array ( |
|
| 42 | - $this->arrConfig[ 'namespace' ], |
|
| 41 | + $arrNames = array( |
|
| 42 | + $this->arrConfig['namespace'], |
|
| 43 | 43 | 'Model' |
| 44 | 44 | ); |
| 45 | - if ( $table->hasSchema () ) |
|
| 45 | + if ($table->hasSchema()) |
|
| 46 | 46 | { |
| 47 | - $arrNames[] = ucfirst ( $table->getSchema () ); |
|
| 47 | + $arrNames[] = ucfirst($table->getSchema()); |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | - return implode ( '_', array_filter ( $arrNames ) ); |
|
| 50 | + return implode('_', array_filter($arrNames)); |
|
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | /** |
@@ -55,9 +55,9 @@ discard block |
||
| 55 | 55 | * |
| 56 | 56 | * @return AbstractAdapter[] |
| 57 | 57 | */ |
| 58 | - public function getMakeFileInstances () |
|
| 58 | + public function getMakeFileInstances() |
|
| 59 | 59 | { |
| 60 | - return array ( |
|
| 60 | + return array( |
|
| 61 | 61 | ); |
| 62 | 62 | } |
| 63 | 63 | |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | |
| 25 | 25 | const SEPARETOR = "_"; |
| 26 | 26 | |
| 27 | - protected function init () |
|
| 27 | + protected function init() |
|
| 28 | 28 | { |
| 29 | 29 | } |
| 30 | 30 | |
@@ -33,75 +33,75 @@ discard block |
||
| 33 | 33 | * |
| 34 | 34 | * @return array |
| 35 | 35 | */ |
| 36 | - protected function getParams () |
|
| 36 | + protected function getParams() |
|
| 37 | 37 | { |
| 38 | - if ( ! $this->config or !$this->isValidFrameworkFiles ()) |
|
| 38 | + if ( ! $this->config or ! $this->isValidFrameworkFiles()) |
|
| 39 | 39 | { |
| 40 | - return array (); |
|
| 40 | + return array(); |
|
| 41 | 41 | } |
| 42 | 42 | |
| 43 | - return array ( |
|
| 43 | + return array( |
|
| 44 | 44 | //Driver do banco de dados |
| 45 | - 'driver' => $this->config[ 'adapter' ] , |
|
| 45 | + 'driver' => $this->config['adapter'], |
|
| 46 | 46 | //Nome do banco de dados |
| 47 | - 'database' => $this->config[ 'params' ][ 'dbname' ] , |
|
| 47 | + 'database' => $this->config['params']['dbname'], |
|
| 48 | 48 | //Host do banco |
| 49 | - 'host' => $this->config[ 'params' ][ 'host' ] , |
|
| 49 | + 'host' => $this->config['params']['host'], |
|
| 50 | 50 | //Port do banco |
| 51 | - 'port' => isset( $this->config[ 'params' ][ 'port' ] ) |
|
| 52 | - ? $this->config[ 'params' ][ 'port' ] : '' , |
|
| 51 | + 'port' => isset($this->config['params']['port']) |
|
| 52 | + ? $this->config['params']['port'] : '', |
|
| 53 | 53 | //usuario do banco |
| 54 | - 'username' => $this->config[ 'params' ][ 'username' ] , |
|
| 54 | + 'username' => $this->config['params']['username'], |
|
| 55 | 55 | //senha do banco |
| 56 | - 'password' => $this->config[ 'params' ][ 'password' ] , |
|
| 56 | + 'password' => $this->config['params']['password'], |
|
| 57 | 57 | ); |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | - protected function parseFrameworkConfig () |
|
| 60 | + protected function parseFrameworkConfig() |
|
| 61 | 61 | { |
| 62 | - if(!$this->isValidFrameworkFiles ()){ |
|
| 62 | + if ( ! $this->isValidFrameworkFiles()) { |
|
| 63 | 63 | return; |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | - $frameworkIni = $this->getFrameworkIni (); |
|
| 66 | + $frameworkIni = $this->getFrameworkIni(); |
|
| 67 | 67 | |
| 68 | 68 | require_once 'Zend/Config/Ini.php'; |
| 69 | 69 | |
| 70 | 70 | $objConfig = new \Zend_Config_Ini( |
| 71 | - realpath ( $frameworkIni ) , $this->getEnvironment () |
|
| 71 | + realpath($frameworkIni), $this->getEnvironment() |
|
| 72 | 72 | ); |
| 73 | 73 | |
| 74 | - $arrConfig = $objConfig->toArray (); |
|
| 74 | + $arrConfig = $objConfig->toArray(); |
|
| 75 | 75 | |
| 76 | - if ( isset( $arrConfig[ 'resources' ][ 'db' ] ) ) |
|
| 76 | + if (isset($arrConfig['resources']['db'])) |
|
| 77 | 77 | { |
| 78 | - $this->config = $arrConfig[ 'resources' ][ 'db' ]; |
|
| 78 | + $this->config = $arrConfig['resources']['db']; |
|
| 79 | 79 | } |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | - public function createClassNamespace ( $table ) |
|
| 82 | + public function createClassNamespace($table) |
|
| 83 | 83 | { |
| 84 | - $arrNames = array ( |
|
| 85 | - $this->arrConfig[ 'namespace' ] , |
|
| 84 | + $arrNames = array( |
|
| 85 | + $this->arrConfig['namespace'], |
|
| 86 | 86 | 'Model' |
| 87 | 87 | ); |
| 88 | 88 | |
| 89 | - if ( isset( $this->arrConfig['folder-database'] ) |
|
| 89 | + if (isset($this->arrConfig['folder-database']) |
|
| 90 | 90 | && $this->arrConfig['folder-database'] |
| 91 | 91 | ) |
| 92 | 92 | { |
| 93 | - $arrNames[] = AbstractMaker::getClassName ( $this->arrConfig['driver'] ); |
|
| 93 | + $arrNames[] = AbstractMaker::getClassName($this->arrConfig['driver']); |
|
| 94 | 94 | } |
| 95 | 95 | |
| 96 | - if ( $table->hasSchema () ) |
|
| 96 | + if ($table->hasSchema()) |
|
| 97 | 97 | { |
| 98 | - $arrNames[] = AbstractMaker::getClassName ( $table->getSchema () ); |
|
| 98 | + $arrNames[] = AbstractMaker::getClassName($table->getSchema()); |
|
| 99 | 99 | } else |
| 100 | 100 | { |
| 101 | - $arrNames[] = AbstractMaker::getClassName ( $table->getDatabase () ); |
|
| 101 | + $arrNames[] = AbstractMaker::getClassName($table->getDatabase()); |
|
| 102 | 102 | } |
| 103 | 103 | |
| 104 | - return implode ( self::SEPARETOR , array_filter ( $arrNames ) ); |
|
| 104 | + return implode(self::SEPARETOR, array_filter($arrNames)); |
|
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | /** |
@@ -109,12 +109,12 @@ discard block |
||
| 109 | 109 | * |
| 110 | 110 | * @return AbstractAdapter[] |
| 111 | 111 | */ |
| 112 | - public function getMakeFileInstances () |
|
| 112 | + public function getMakeFileInstances() |
|
| 113 | 113 | { |
| 114 | - return array ( |
|
| 115 | - DbTable::getInstance () , |
|
| 116 | - Entity::getInstance () , |
|
| 117 | - Model::getInstance () |
|
| 114 | + return array( |
|
| 115 | + DbTable::getInstance(), |
|
| 116 | + Entity::getInstance(), |
|
| 117 | + Model::getInstance() |
|
| 118 | 118 | ); |
| 119 | 119 | } |
| 120 | 120 | |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | |
| 23 | 23 | const SEPARETOR = "_"; |
| 24 | 24 | |
| 25 | - protected function init () |
|
| 25 | + protected function init() |
|
| 26 | 26 | { |
| 27 | 27 | } |
| 28 | 28 | |
@@ -31,31 +31,31 @@ discard block |
||
| 31 | 31 | * |
| 32 | 32 | * @return array |
| 33 | 33 | */ |
| 34 | - protected function getParams () |
|
| 34 | + protected function getParams() |
|
| 35 | 35 | { |
| 36 | 36 | |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | - protected function parseFrameworkConfig () |
|
| 39 | + protected function parseFrameworkConfig() |
|
| 40 | 40 | { |
| 41 | 41 | // TODO: Implement parseFrameworkConfig() method. |
| 42 | 42 | } |
| 43 | 43 | |
| 44 | - public function createClassNamespace ( $table ) |
|
| 44 | + public function createClassNamespace($table) |
|
| 45 | 45 | { |
| 46 | - $arrNames = array ( |
|
| 47 | - $this->arrConfig[ 'namespace' ], |
|
| 46 | + $arrNames = array( |
|
| 47 | + $this->arrConfig['namespace'], |
|
| 48 | 48 | 'Model' |
| 49 | 49 | ); |
| 50 | - if ( $table->hasSchema () ) |
|
| 50 | + if ($table->hasSchema()) |
|
| 51 | 51 | { |
| 52 | - $arrNames[] = AbstractMaker::getClassName ( $table->getSchema () ); |
|
| 52 | + $arrNames[] = AbstractMaker::getClassName($table->getSchema()); |
|
| 53 | 53 | } else |
| 54 | 54 | { |
| 55 | - $arrNames[] = AbstractMaker::getClassName ( $table->getDatabase() ); |
|
| 55 | + $arrNames[] = AbstractMaker::getClassName($table->getDatabase()); |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | - return implode ( '_', array_filter ( $arrNames ) ); |
|
| 58 | + return implode('_', array_filter($arrNames)); |
|
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | /** |
@@ -63,12 +63,12 @@ discard block |
||
| 63 | 63 | * |
| 64 | 64 | * @return AbstractAdapter[] |
| 65 | 65 | */ |
| 66 | - public function getMakeFileInstances () |
|
| 66 | + public function getMakeFileInstances() |
|
| 67 | 67 | { |
| 68 | - return array ( |
|
| 69 | - DbTable::getInstance (), |
|
| 70 | - Entity::getInstance (), |
|
| 71 | - Model::getInstance () |
|
| 68 | + return array( |
|
| 69 | + DbTable::getInstance(), |
|
| 70 | + Entity::getInstance(), |
|
| 71 | + Model::getInstance() |
|
| 72 | 72 | ); |
| 73 | 73 | } |
| 74 | 74 | |
@@ -16,9 +16,9 @@ |
||
| 16 | 16 | { |
| 17 | 17 | private $msg = "As configuracoes a seguir sao obrigatorias: \033[0;31m%value%\033[0m"; |
| 18 | 18 | |
| 19 | - public function __construct ( $array , $code = 0 ) |
|
| 19 | + public function __construct($array, $code = 0) |
|
| 20 | 20 | { |
| 21 | - $attribs = implode ( ', ' , array_keys ( $array ) ); |
|
| 22 | - parent::__construct ( str_replace ( "%value%" , $attribs , $this->msg ) , (int) $code ); |
|
| 21 | + $attribs = implode(', ', array_keys($array)); |
|
| 22 | + parent::__construct(str_replace("%value%", $attribs, $this->msg), (int) $code); |
|
| 23 | 23 | } |
| 24 | 24 | } |
| 25 | 25 | \ No newline at end of file |