@@ -44,8 +44,8 @@ discard block |
||
| 44 | 44 | public function create() |
| 45 | 45 | { |
| 46 | 46 | $migrationName = ModelsInterface::MIGRATION_CREATE . PhpInterface::UNDERSCORE . |
| 47 | - $this->tableName . |
|
| 48 | - PhpInterface::UNDERSCORE . ModelsInterface::MIGRATION_TABLE; |
|
| 47 | + $this->tableName . |
|
| 48 | + PhpInterface::UNDERSCORE . ModelsInterface::MIGRATION_TABLE; |
|
| 49 | 49 | $attrKey = $this->generator->objectName . CustomsInterface::CUSTOM_TYPES_ATTRIBUTES; |
| 50 | 50 | |
| 51 | 51 | $isFileNonExistent = FileManager::migrationNotExists($this->generator, $migrationName); |
@@ -82,20 +82,20 @@ discard block |
||
| 82 | 82 | foreach($relations as $relationEntity) |
| 83 | 83 | { |
| 84 | 84 | $entityFile = $this->generator->formatEntitiesPath() |
| 85 | - . PhpInterface::SLASH . |
|
| 86 | - $this->generator->objectName . |
|
| 87 | - ucfirst($relationEntity) . |
|
| 88 | - PhpInterface::PHP_EXT; |
|
| 85 | + . PhpInterface::SLASH . |
|
| 86 | + $this->generator->objectName . |
|
| 87 | + ucfirst($relationEntity) . |
|
| 88 | + PhpInterface::PHP_EXT; |
|
| 89 | 89 | if(file_exists($entityFile)) |
| 90 | 90 | { |
| 91 | 91 | $this->setPivotContent($relationEntity); |
| 92 | 92 | |
| 93 | 93 | $migrationMask = date(self::PATTERN_TIME) . (self::$counter + 1); |
| 94 | 94 | $migrationName = ModelsInterface::MIGRATION_CREATE . PhpInterface::UNDERSCORE |
| 95 | - . $this->tableName |
|
| 96 | - . PhpInterface::UNDERSCORE . |
|
| 97 | - MigrationsHelper::getTableName($relationEntity) . |
|
| 98 | - PhpInterface::UNDERSCORE . ModelsInterface::MIGRATION_TABLE; |
|
| 95 | + . $this->tableName |
|
| 96 | + . PhpInterface::UNDERSCORE . |
|
| 97 | + MigrationsHelper::getTableName($relationEntity) . |
|
| 98 | + PhpInterface::UNDERSCORE . ModelsInterface::MIGRATION_TABLE; |
|
| 99 | 99 | |
| 100 | 100 | if(FileManager::migrationNotExists($this->generator, $migrationName)) |
| 101 | 101 | { |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | $isFileNonExistent = FileManager::migrationNotExists($this->generator, $migrationName); |
| 52 | 52 | $isAdding = ($this->generator->isMerge === true && empty($this->generator->diffTypes[$attrKey]) === false); |
| 53 | 53 | |
| 54 | - if($isFileNonExistent === true) |
|
| 54 | + if ($isFileNonExistent === true) |
|
| 55 | 55 | { |
| 56 | 56 | $this->setContent(); |
| 57 | 57 | } else if ($isAdding === true) { |
@@ -76,17 +76,17 @@ discard block |
||
| 76 | 76 | $formRequestEntity = $this->getFormRequestEntity($this->generator->version, $this->className); |
| 77 | 77 | /** @var BaseFormRequest $formRequest **/ |
| 78 | 78 | $formRequest = new $formRequestEntity(); |
| 79 | - if(method_exists($formRequest, ModelsInterface::MODEL_METHOD_RELATIONS)) |
|
| 79 | + if (method_exists($formRequest, ModelsInterface::MODEL_METHOD_RELATIONS)) |
|
| 80 | 80 | { |
| 81 | 81 | $relations = $formRequest->relations(); |
| 82 | - foreach($relations as $relationEntity) |
|
| 82 | + foreach ($relations as $relationEntity) |
|
| 83 | 83 | { |
| 84 | 84 | $entityFile = $this->generator->formatEntitiesPath() |
| 85 | 85 | . PhpInterface::SLASH . |
| 86 | 86 | $this->generator->objectName . |
| 87 | 87 | ucfirst($relationEntity) . |
| 88 | 88 | PhpInterface::PHP_EXT; |
| 89 | - if(file_exists($entityFile)) |
|
| 89 | + if (file_exists($entityFile)) |
|
| 90 | 90 | { |
| 91 | 91 | $this->setPivotContent($relationEntity); |
| 92 | 92 | |
@@ -97,13 +97,13 @@ discard block |
||
| 97 | 97 | MigrationsHelper::getTableName($relationEntity) . |
| 98 | 98 | PhpInterface::UNDERSCORE . ModelsInterface::MIGRATION_TABLE; |
| 99 | 99 | |
| 100 | - if(FileManager::migrationNotExists($this->generator, $migrationName)) |
|
| 100 | + if (FileManager::migrationNotExists($this->generator, $migrationName)) |
|
| 101 | 101 | { |
| 102 | 102 | $file = $this->generator->formatMigrationsPath() . $migrationMask |
| 103 | 103 | . PhpInterface::UNDERSCORE . $migrationName . PhpInterface::PHP_EXT; |
| 104 | 104 | // if migration file with the same name ocasionally exists we do not override it |
| 105 | 105 | $isCreated = FileManager::createFile($file, $this->sourceCode); |
| 106 | - if($isCreated) |
|
| 106 | + if ($isCreated) |
|
| 107 | 107 | { |
| 108 | 108 | Console::out($file . PhpInterface::SPACE . Console::CREATED, Console::COLOR_GREEN); |
| 109 | 109 | } |