@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | /** |
| 16 | 16 | * @var $type |
| 17 | 17 | */ |
| 18 | - public $type='model'; |
|
| 18 | + public $type = 'model'; |
|
| 19 | 19 | |
| 20 | 20 | /** |
| 21 | 21 | * @var array |
@@ -32,17 +32,17 @@ discard block |
||
| 32 | 32 | /** |
| 33 | 33 | * @var $commandRule |
| 34 | 34 | */ |
| 35 | - public $commandRule=['model','?table']; |
|
| 35 | + public $commandRule = ['model', '?table']; |
|
| 36 | 36 | |
| 37 | 37 | /** |
| 38 | 38 | * @method create |
| 39 | 39 | * @return mixed |
| 40 | 40 | */ |
| 41 | - public function create(){
|
|
| 41 | + public function create() {
|
|
| 42 | 42 | |
| 43 | 43 | $this->argument['file'] = $this->argument['model']; |
| 44 | 44 | |
| 45 | - if(!isset($this->argument['table'])){
|
|
| 45 | + if (!isset($this->argument['table'])) {
|
|
| 46 | 46 | $this->argument['table'] = $this->argument['file'].'s'; |
| 47 | 47 | } |
| 48 | 48 | |
@@ -66,11 +66,11 @@ discard block |
||
| 66 | 66 | $this->touch['model/builder'] = $this->directory['builderDir'].''.DIRECTORY_SEPARATOR.''.$this->argument['file'].'Builder.php'; |
| 67 | 67 | $this->touch['model/contract'] = $this->directory['contract'].''.DIRECTORY_SEPARATOR.''.$this->argument['file'].'Contract.php'; |
| 68 | 68 | |
| 69 | - if(!file_exists($this->directory['helper'].''.DIRECTORY_SEPARATOR.'Scope.php')){
|
|
| 69 | + if (!file_exists($this->directory['helper'].''.DIRECTORY_SEPARATOR.'Scope.php')) {
|
|
| 70 | 70 | $this->touch['model/scope'] = $this->directory['helper'].''.DIRECTORY_SEPARATOR.'Scope.php'; |
| 71 | 71 | } |
| 72 | 72 | |
| 73 | - if(!file_exists($this->directory['helper'].''.DIRECTORY_SEPARATOR.'Event.php')){
|
|
| 73 | + if (!file_exists($this->directory['helper'].''.DIRECTORY_SEPARATOR.'Event.php')) {
|
|
| 74 | 74 | $this->touch['model/event'] = $this->directory['helper'].''.DIRECTORY_SEPARATOR.'Event.php'; |
| 75 | 75 | } |
| 76 | 76 | |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | |
| 79 | 79 | $entityDir = $this->directory['modelDir'].''.DIRECTORY_SEPARATOR.'Entity'; |
| 80 | 80 | |
| 81 | - if(!file_exists($entityDir)){
|
|
| 81 | + if (!file_exists($entityDir)) {
|
|
| 82 | 82 | files()->makeDirectory($entityDir); |
| 83 | 83 | } |
| 84 | 84 | |
@@ -87,9 +87,9 @@ discard block |
||
| 87 | 87 | $entityClass = $entityDir.''.DIRECTORY_SEPARATOR.''.$entityTableName.''.DIRECTORY_SEPARATOR.''.$entityTableName; |
| 88 | 88 | |
| 89 | 89 | |
| 90 | - $generator = new Generator($entityDir,'EntityMap'); |
|
| 90 | + $generator = new Generator($entityDir, 'EntityMap'); |
|
| 91 | 91 | |
| 92 | - if(!file_exists($entityDir.''.DIRECTORY_SEPARATOR.'EntityMap.php')){
|
|
| 92 | + if (!file_exists($entityDir.''.DIRECTORY_SEPARATOR.'EntityMap.php')) {
|
|
| 93 | 93 | |
| 94 | 94 | //$this->setAnnotations(); |
| 95 | 95 | $generator->createClass(); |
@@ -123,15 +123,15 @@ discard block |
||
| 123 | 123 | |
| 124 | 124 | |
| 125 | 125 | //set builder map |
| 126 | - $generator = new Generator($this->directory['builderDir'],'BuilderMap'); |
|
| 126 | + $generator = new Generator($this->directory['builderDir'], 'BuilderMap'); |
|
| 127 | 127 | |
| 128 | - if(!file_exists($this->directory['builderDir'].''.DIRECTORY_SEPARATOR.'BuilderMap.php')){
|
|
| 128 | + if (!file_exists($this->directory['builderDir'].''.DIRECTORY_SEPARATOR.'BuilderMap.php')) {
|
|
| 129 | 129 | |
| 130 | 130 | $this->setAnnotations(); |
| 131 | 131 | $generator->createClass(); |
| 132 | 132 | } |
| 133 | 133 | |
| 134 | - if(!file_exists($this->touch['model/model'])){
|
|
| 134 | + if (!file_exists($this->touch['model/model'])) {
|
|
| 135 | 135 | |
| 136 | 136 | $generator->createMethod([ |
| 137 | 137 | strtolower($this->argument['file']) |
@@ -152,7 +152,7 @@ discard block |
||
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | //set project touch |
| 155 | - $this->file->touch($this,[ |
|
| 155 | + $this->file->touch($this, [ |
|
| 156 | 156 | 'stub'=>'Model_Create' |
| 157 | 157 | ]); |
| 158 | 158 | |
@@ -163,11 +163,11 @@ discard block |
||
| 163 | 163 | /** |
| 164 | 164 | * @return bool |
| 165 | 165 | */ |
| 166 | - private function setAnnotations(){
|
|
| 166 | + private function setAnnotations() {
|
|
| 167 | 167 | |
| 168 | 168 | $entityMap = app()->path()->model().''.DIRECTORY_SEPARATOR.'Entity'.DIRECTORY_SEPARATOR.'EntityMap.php'; |
| 169 | 169 | |
| 170 | - if(file_exists($entityMap)){
|
|
| 170 | + if (file_exists($entityMap)) {
|
|
| 171 | 171 | |
| 172 | 172 | Utils::changeClass(path()->serviceAnnotations().'.php', |
| 173 | 173 | [ |