@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | /** |
| 33 | 33 | * @var array |
| 34 | 34 | */ |
| 35 | - public $commandRule=['name','client']; |
|
| 35 | + public $commandRule = ['name', 'client']; |
|
| 36 | 36 | |
| 37 | 37 | /** |
| 38 | 38 | * @method create |
@@ -56,25 +56,25 @@ discard block |
||
| 56 | 56 | |
| 57 | 57 | $this->argument['managerTraitNamespace'] = Utils::getNamespace($this->directory['clientNameDir'].'/'.$name.'Trait.php'); |
| 58 | 58 | |
| 59 | - if(!file_exists($manager = $this->directory['clientNameDir'].'/'.$name.'Manager.php')){
|
|
| 59 | + if (!file_exists($manager = $this->directory['clientNameDir'].'/'.$name.'Manager.php')) {
|
|
| 60 | 60 | $this->touch['client/manager'] = $manager; |
| 61 | 61 | $this->touch['client/managertrait'] = $this->directory['clientNameDir'].'/'.$name.'Trait.php'; |
| 62 | 62 | |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | - if(!file_exists($this->directory['clientNameCreate'].'/Client.php')){
|
|
| 65 | + if (!file_exists($this->directory['clientNameCreate'].'/Client.php')) {
|
|
| 66 | 66 | $this->touch['client/client'] = $this->directory['clientNameCreate'].'/Client.php'; |
| 67 | 67 | $this->touch['client/clientGenerator'] = $this->directory['clientNameCreate'].'/ClientGenerator.php'; |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | $clientSourceNamespace = Utils::getNamespace($this->directory['clientSource'].'/'.$client.'.php'); |
| 71 | 71 | |
| 72 | - if(!file_exists($clientSourceName = $this->directory['clientSource'].'/'.$client.'.php')){
|
|
| 72 | + if (!file_exists($clientSourceName = $this->directory['clientSource'].'/'.$client.'.php')) {
|
|
| 73 | 73 | $this->touch['client/source'] = $clientSourceName.''; |
| 74 | 74 | //$this->touch['client/sourcegenerator'] = $this->directory['clientSource'].'/'.$client.'Generator.php'; |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | - if(!file_exists($this->directory['clientNameCreate'].'/ClientProvider.php')){
|
|
| 77 | + if (!file_exists($this->directory['clientNameCreate'].'/ClientProvider.php')) {
|
|
| 78 | 78 | $this->touch['client/clientProvider'] = $this->directory['clientNameCreate'].'/ClientProvider.php'; |
| 79 | 79 | } |
| 80 | 80 | |
@@ -88,13 +88,13 @@ discard block |
||
| 88 | 88 | |
| 89 | 89 | $nameGeneratorNamespace = Utils::getNamespace($managerPath = $this->directory['clientNameDir'].''.DIRECTORY_SEPARATOR.''.$nameManager.'.php'); |
| 90 | 90 | |
| 91 | - $generator = new Generator(path()->version(),'ClientManager'); |
|
| 91 | + $generator = new Generator(path()->version(), 'ClientManager'); |
|
| 92 | 92 | |
| 93 | 93 | $clientManager = app()->namespace()->version().'\\ClientManager'; |
| 94 | 94 | |
| 95 | 95 | $clientManagerResolve = new $clientManager; |
| 96 | 96 | |
| 97 | - if(!method_exists($clientManagerResolve,strtolower($name))){
|
|
| 97 | + if (!method_exists($clientManagerResolve, strtolower($name))) {
|
|
| 98 | 98 | |
| 99 | 99 | $generator->createMethod([ |
| 100 | 100 | strtolower($name) |
@@ -125,11 +125,11 @@ discard block |
||
| 125 | 125 | |
| 126 | 126 | } |
| 127 | 127 | |
| 128 | - $nameGenerator = new Generator($this->directory['clientNameDir'],$name.'Manager'); |
|
| 128 | + $nameGenerator = new Generator($this->directory['clientNameDir'], $name.'Manager'); |
|
| 129 | 129 | |
| 130 | 130 | $nameGeneratorNamespaceResolve = new $nameGeneratorNamespace; |
| 131 | 131 | |
| 132 | - if(!method_exists($nameGeneratorNamespaceResolve,strtolower($client))){
|
|
| 132 | + if (!method_exists($nameGeneratorNamespaceResolve, strtolower($client))) {
|
|
| 133 | 133 | |
| 134 | 134 | $nameGenerator->createMethod([ |
| 135 | 135 | strtolower($client) |
@@ -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 | |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | |
| 52 | 52 | $this->directory['modelDir'] = app()->path()->model(); |
| 53 | 53 | $this->directory['builderDir'] = $this->directory['modelDir'].'/Builder'; |
| 54 | - $this->directory['builderAssistantDir'] = $this->directory['modelDir'].'/Builder/Assistant'; |
|
| 54 | + $this->directory['builderAssistantDir'] = $this->directory['modelDir'].'/Builder/Assistant'; |
|
| 55 | 55 | $this->directory['contract'] = $this->directory['modelDir'].'/Contract'; |
| 56 | 56 | $this->directory['helper'] = $this->directory['modelDir'].'/Helper'; |
| 57 | 57 | |
@@ -66,14 +66,14 @@ discard block |
||
| 66 | 66 | //model set |
| 67 | 67 | $this->touch['model/model'] = $this->directory['modelDir'].''.DIRECTORY_SEPARATOR.''.$this->argument['file'].'.php'; |
| 68 | 68 | $this->touch['model/builder'] = $this->directory['builderDir'].''.DIRECTORY_SEPARATOR.''.$this->argument['file'].'Builder.php'; |
| 69 | - $this->touch['model/builderasistant'] = $this->directory['builderAssistantDir'].''.DIRECTORY_SEPARATOR.'Builder.php'; |
|
| 69 | + $this->touch['model/builderasistant'] = $this->directory['builderAssistantDir'].''.DIRECTORY_SEPARATOR.'Builder.php'; |
|
| 70 | 70 | $this->touch['model/contract'] = $this->directory['contract'].''.DIRECTORY_SEPARATOR.''.$this->argument['file'].'Contract.php'; |
| 71 | 71 | |
| 72 | - if(!file_exists($this->directory['helper'].''.DIRECTORY_SEPARATOR.'Scope.php')){
|
|
| 72 | + if (!file_exists($this->directory['helper'].''.DIRECTORY_SEPARATOR.'Scope.php')) {
|
|
| 73 | 73 | $this->touch['model/scope'] = $this->directory['helper'].''.DIRECTORY_SEPARATOR.'Scope.php'; |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | - if(!file_exists($this->directory['helper'].''.DIRECTORY_SEPARATOR.'Event.php')){
|
|
| 76 | + if (!file_exists($this->directory['helper'].''.DIRECTORY_SEPARATOR.'Event.php')) {
|
|
| 77 | 77 | $this->touch['model/event'] = $this->directory['helper'].''.DIRECTORY_SEPARATOR.'Event.php'; |
| 78 | 78 | } |
| 79 | 79 | |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | |
| 82 | 82 | $entityDir = $this->directory['modelDir'].''.DIRECTORY_SEPARATOR.'Entity'; |
| 83 | 83 | |
| 84 | - if(!file_exists($entityDir)){
|
|
| 84 | + if (!file_exists($entityDir)) {
|
|
| 85 | 85 | files()->makeDirectory($entityDir); |
| 86 | 86 | } |
| 87 | 87 | |
@@ -90,9 +90,9 @@ discard block |
||
| 90 | 90 | $entityClass = $entityDir.''.DIRECTORY_SEPARATOR.''.$entityTableName.''.DIRECTORY_SEPARATOR.''.$entityTableName; |
| 91 | 91 | |
| 92 | 92 | |
| 93 | - $generator = new Generator($entityDir,'EntityMap'); |
|
| 93 | + $generator = new Generator($entityDir, 'EntityMap'); |
|
| 94 | 94 | |
| 95 | - if(!file_exists($entityDir.''.DIRECTORY_SEPARATOR.'EntityMap.php')){
|
|
| 95 | + if (!file_exists($entityDir.''.DIRECTORY_SEPARATOR.'EntityMap.php')) {
|
|
| 96 | 96 | |
| 97 | 97 | //$this->setAnnotations(); |
| 98 | 98 | $generator->createClass(); |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | |
| 103 | 103 | $entityMapNamespaceResolve = new $entityMapNamespace; |
| 104 | 104 | |
| 105 | - if(!method_exists($entityMapNamespaceResolve,strtolower($this->argument['table']))){
|
|
| 105 | + if (!method_exists($entityMapNamespaceResolve, strtolower($this->argument['table']))) {
|
|
| 106 | 106 | |
| 107 | 107 | $generator->createClassUse([ |
| 108 | 108 | Utils::getNamespace($entityClass) |
@@ -132,15 +132,15 @@ discard block |
||
| 132 | 132 | |
| 133 | 133 | |
| 134 | 134 | //set builder map |
| 135 | - $generator = new Generator($this->directory['builderDir'],'BuilderMap'); |
|
| 135 | + $generator = new Generator($this->directory['builderDir'], 'BuilderMap'); |
|
| 136 | 136 | |
| 137 | - if(!file_exists($this->directory['builderDir'].''.DIRECTORY_SEPARATOR.'BuilderMap.php')){
|
|
| 137 | + if (!file_exists($this->directory['builderDir'].''.DIRECTORY_SEPARATOR.'BuilderMap.php')) {
|
|
| 138 | 138 | |
| 139 | 139 | $this->setAnnotations(); |
| 140 | 140 | $generator->createClass(); |
| 141 | 141 | } |
| 142 | 142 | |
| 143 | - if(!file_exists($this->touch['model/model'])){
|
|
| 143 | + if (!file_exists($this->touch['model/model'])) {
|
|
| 144 | 144 | |
| 145 | 145 | $generator->createMethod([ |
| 146 | 146 | strtolower($this->argument['file']) |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | } |
| 162 | 162 | |
| 163 | 163 | //set project touch |
| 164 | - $this->file->touch($this,[ |
|
| 164 | + $this->file->touch($this, [ |
|
| 165 | 165 | 'stub'=>'Model_Create' |
| 166 | 166 | ]); |
| 167 | 167 | |
@@ -172,11 +172,11 @@ discard block |
||
| 172 | 172 | /** |
| 173 | 173 | * @return bool |
| 174 | 174 | */ |
| 175 | - private function setAnnotations(){
|
|
| 175 | + private function setAnnotations() {
|
|
| 176 | 176 | |
| 177 | 177 | $entityMap = app()->path()->model().''.DIRECTORY_SEPARATOR.'Entity'.DIRECTORY_SEPARATOR.'EntityMap.php'; |
| 178 | 178 | |
| 179 | - if(file_exists($entityMap)){
|
|
| 179 | + if (file_exists($entityMap)) {
|
|
| 180 | 180 | |
| 181 | 181 | Utils::changeClass(path()->serviceAnnotations().'.php', |
| 182 | 182 | [ |