@@ -44,8 +44,8 @@ discard block |
||
| 44 | 44 | //Generating the templates translations |
| 45 | 45 | $translations = $this->tpl->regenerateTemplates(); |
| 46 | 46 | |
| 47 | - $localePath = realpath(BASE_DIR . DIRECTORY_SEPARATOR . 'locale'); |
|
| 48 | - $localePath .= DIRECTORY_SEPARATOR . $locale . DIRECTORY_SEPARATOR . 'LC_MESSAGES' . DIRECTORY_SEPARATOR; |
|
| 47 | + $localePath = realpath(BASE_DIR.DIRECTORY_SEPARATOR.'locale'); |
|
| 48 | + $localePath .= DIRECTORY_SEPARATOR.$locale.DIRECTORY_SEPARATOR.'LC_MESSAGES'.DIRECTORY_SEPARATOR; |
|
| 49 | 49 | |
| 50 | 50 | //xgettext localizations |
| 51 | 51 | $translations = array_merge($translations, I18nHelper::findTranslations(SOURCE_DIR, $locale)); |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | $translations = array_merge($translations, I18nHelper::findTranslations(CACHE_DIR, $locale)); |
| 54 | 54 | |
| 55 | 55 | $translations[] = "msgfmt {$localePath}translations.po -o {$localePath}translations.mo"; |
| 56 | - $translations[] = shell_exec('export PATH=\$PATH:/opt/local/bin:/bin:/sbin; msgfmt ' . $localePath . 'translations.po -o ' . $localePath . 'translations.mo'); |
|
| 56 | + $translations[] = shell_exec('export PATH=\$PATH:/opt/local/bin:/bin:/sbin; msgfmt '.$localePath.'translations.po -o '.$localePath.'translations.mo'); |
|
| 57 | 57 | return $this->render('translations.html.twig', array( |
| 58 | 58 | 'translations' => $translations, |
| 59 | 59 | )); |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | */ |
| 25 | 25 | public function getConnectionManager(string $module, string $path): array |
| 26 | 26 | { |
| 27 | - $modulePath = str_replace(CORE_DIR . DIRECTORY_SEPARATOR, '', $path . $module); |
|
| 27 | + $modulePath = str_replace(CORE_DIR.DIRECTORY_SEPARATOR, '', $path.$module); |
|
| 28 | 28 | $generatorConfig = $this->getConfigGenerator($modulePath); |
| 29 | 29 | |
| 30 | 30 | $manager = new MigrationManager(); |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | $migrationFileName = $manager->getMigrationFileName($timestamp); |
| 116 | 116 | $migrationClassBody = $manager->getMigrationClassBody($migrationsUp, $migrationsDown, $timestamp); |
| 117 | 117 | |
| 118 | - $file = $generatorConfig->getSection('paths')['migrationDir'] . DIRECTORY_SEPARATOR . $migrationFileName; |
|
| 118 | + $file = $generatorConfig->getSection('paths')['migrationDir'].DIRECTORY_SEPARATOR.$migrationFileName; |
|
| 119 | 119 | file_put_contents($file, $migrationClassBody); |
| 120 | 120 | |
| 121 | 121 | Logger::log(sprintf('"%s" file successfully created.', $file)); |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | */ |
| 50 | 50 | public function createStructureModule(string $module, bool $force = false, string $type = "", string $apiClass = "", bool $skipMigration = false): void |
| 51 | 51 | { |
| 52 | - $modPath = CORE_DIR . DIRECTORY_SEPARATOR; |
|
| 52 | + $modPath = CORE_DIR.DIRECTORY_SEPARATOR; |
|
| 53 | 53 | $module = ucfirst($module); |
| 54 | 54 | $this->createModulePath($module, $modPath); |
| 55 | 55 | $this->createModulePathTree($module, $modPath); |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | */ |
| 74 | 74 | private function createModuleBaseFiles($module, $modPath, $force = false, $controllerType = '') |
| 75 | 75 | { |
| 76 | - $modulePath = $modPath . $module; |
|
| 76 | + $modulePath = $modPath.$module; |
|
| 77 | 77 | $this->generateControllerTemplate($module, $modulePath, $force, $controllerType); |
| 78 | 78 | $this->generateServiceTemplate($module, $modulePath, $force); |
| 79 | 79 | $this->generateSchemaTemplate($module, $modulePath, $force); |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | $this->genereateAutoloaderTemplate($module, $modulePath, $force); |
| 95 | 95 | $this->generatePropertiesTemplate($module, $modulePath, $force); |
| 96 | 96 | $this->generateConfigTemplate($modulePath, $force); |
| 97 | - $this->createModuleModels($module, CORE_DIR . DIRECTORY_SEPARATOR); |
|
| 97 | + $this->createModuleModels($module, CORE_DIR.DIRECTORY_SEPARATOR); |
|
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | /** |
@@ -114,26 +114,26 @@ discard block |
||
| 114 | 114 | "namespace" => preg_replace('/(\\\|\/)/', '\\', $module), |
| 115 | 115 | "url" => preg_replace('/(\\\|\/)/', '/', $module), |
| 116 | 116 | "class" => $class, |
| 117 | - "controllerType" => $class . "Base", |
|
| 117 | + "controllerType" => $class."Base", |
|
| 118 | 118 | "is_base" => false |
| 119 | 119 | )); |
| 120 | - $controller = $this->writeTemplateToFile($controllerBody, $modPath . DIRECTORY_SEPARATOR . "Controller" . |
|
| 121 | - DIRECTORY_SEPARATOR . "{$class}Controller.php", $force); |
|
| 120 | + $controller = $this->writeTemplateToFile($controllerBody, $modPath.DIRECTORY_SEPARATOR."Controller". |
|
| 121 | + DIRECTORY_SEPARATOR."{$class}Controller.php", $force); |
|
| 122 | 122 | |
| 123 | 123 | $controllerBody = $this->tpl->dump("generator/controller.template.twig", array( |
| 124 | 124 | "module" => $module, |
| 125 | 125 | "namespace" => preg_replace('/(\\\|\/)/', '\\', $module), |
| 126 | 126 | "url" => preg_replace('/(\\\|\/)/', '/', $module), |
| 127 | - "class" => $class . "Base", |
|
| 127 | + "class" => $class."Base", |
|
| 128 | 128 | "service" => $class, |
| 129 | 129 | "controllerType" => $controllerType, |
| 130 | 130 | "is_base" => true, |
| 131 | 131 | "domain" => $class, |
| 132 | 132 | )); |
| 133 | - $controllerBase = $this->writeTemplateToFile($controllerBody, $modPath . DIRECTORY_SEPARATOR . "Controller" . |
|
| 134 | - DIRECTORY_SEPARATOR . "base" . DIRECTORY_SEPARATOR . "{$class}BaseController.php", true); |
|
| 133 | + $controllerBase = $this->writeTemplateToFile($controllerBody, $modPath.DIRECTORY_SEPARATOR."Controller". |
|
| 134 | + DIRECTORY_SEPARATOR."base".DIRECTORY_SEPARATOR."{$class}BaseController.php", true); |
|
| 135 | 135 | |
| 136 | - $filename = $modPath . DIRECTORY_SEPARATOR . "Test" . DIRECTORY_SEPARATOR . "{$class}Test.php"; |
|
| 136 | + $filename = $modPath.DIRECTORY_SEPARATOR."Test".DIRECTORY_SEPARATOR."{$class}Test.php"; |
|
| 137 | 137 | $test = true; |
| 138 | 138 | if (!file_exists($filename)) { |
| 139 | 139 | $testTemplate = $this->tpl->dump("generator/testCase.template.twig", array( |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | */ |
| 155 | 155 | private function createModuleModels($module, $path) |
| 156 | 156 | { |
| 157 | - $modulePath = str_replace(CORE_DIR . DIRECTORY_SEPARATOR, '', $path . $module); |
|
| 157 | + $modulePath = str_replace(CORE_DIR.DIRECTORY_SEPARATOR, '', $path.$module); |
|
| 158 | 158 | $configGenerator = $this->getConfigGenerator($modulePath); |
| 159 | 159 | |
| 160 | 160 | $this->buildModels($configGenerator); |
@@ -163,8 +163,8 @@ discard block |
||
| 163 | 163 | $configTemplate = $this->tpl->dump("generator/config.propel.template.twig", array( |
| 164 | 164 | "module" => $module, |
| 165 | 165 | )); |
| 166 | - $this->writeTemplateToFile($configTemplate, CORE_DIR . DIRECTORY_SEPARATOR . $modulePath . DIRECTORY_SEPARATOR . "Config" . |
|
| 167 | - DIRECTORY_SEPARATOR . "config.php", true); |
|
| 166 | + $this->writeTemplateToFile($configTemplate, CORE_DIR.DIRECTORY_SEPARATOR.$modulePath.DIRECTORY_SEPARATOR."Config". |
|
| 167 | + DIRECTORY_SEPARATOR."config.php", true); |
|
| 168 | 168 | Logger::log("Generado config genérico para propel"); |
| 169 | 169 | } |
| 170 | 170 | |
@@ -199,7 +199,7 @@ discard block |
||
| 199 | 199 | |
| 200 | 200 | if ($totalNbTables) { |
| 201 | 201 | Logger::log(sprintf('%d tables found in all databases.', $totalNbTables)); |
| 202 | - } else { |
|
| 202 | + }else { |
|
| 203 | 203 | Logger::log('No table found in all databases'); |
| 204 | 204 | } |
| 205 | 205 | |
@@ -256,8 +256,8 @@ discard block |
||
| 256 | 256 | private function generateBaseApiTemplate($module, $modPath, $force = false, $apiClass = "") |
| 257 | 257 | { |
| 258 | 258 | $created = true; |
| 259 | - $modelPath = $modPath . $module . DIRECTORY_SEPARATOR . 'Models'; |
|
| 260 | - $apiPath = $modPath . $module . DIRECTORY_SEPARATOR . 'Api'; |
|
| 259 | + $modelPath = $modPath.$module.DIRECTORY_SEPARATOR.'Models'; |
|
| 260 | + $apiPath = $modPath.$module.DIRECTORY_SEPARATOR.'Api'; |
|
| 261 | 261 | if (file_exists($modelPath)) { |
| 262 | 262 | $dir = dir($modelPath); |
| 263 | 263 | $this->generateApiFiles($module, $force, $apiClass, $dir, $apiPath); |
@@ -275,7 +275,7 @@ discard block |
||
| 275 | 275 | //Generamos el fichero de configuración |
| 276 | 276 | Logger::log("Generamos fichero vacío de configuración"); |
| 277 | 277 | return $this->writeTemplateToFile("<?php\n\t", |
| 278 | - $modPath . DIRECTORY_SEPARATOR . "Config" . DIRECTORY_SEPARATOR . "config.php", |
|
| 278 | + $modPath.DIRECTORY_SEPARATOR."Config".DIRECTORY_SEPARATOR."config.php", |
|
| 279 | 279 | $force); |
| 280 | 280 | } |
| 281 | 281 | |
@@ -296,7 +296,7 @@ discard block |
||
| 296 | 296 | "db" => $this->config->get("db_name"), |
| 297 | 297 | )); |
| 298 | 298 | return $this->writeTemplateToFile($schema, |
| 299 | - $modPath . DIRECTORY_SEPARATOR . "Config" . DIRECTORY_SEPARATOR . "schema.xml", |
|
| 299 | + $modPath.DIRECTORY_SEPARATOR."Config".DIRECTORY_SEPARATOR."schema.xml", |
|
| 300 | 300 | $force); |
| 301 | 301 | } |
| 302 | 302 | |
@@ -314,7 +314,7 @@ discard block |
||
| 314 | 314 | "namespace" => preg_replace('/(\\\|\/)/', '', $module), |
| 315 | 315 | )); |
| 316 | 316 | return $this->writeTemplateToFile($buildProperties, |
| 317 | - $modPath . DIRECTORY_SEPARATOR . "Config" . DIRECTORY_SEPARATOR . "propel.php", |
|
| 317 | + $modPath.DIRECTORY_SEPARATOR."Config".DIRECTORY_SEPARATOR."propel.php", |
|
| 318 | 318 | $force); |
| 319 | 319 | } |
| 320 | 320 | |
@@ -332,7 +332,7 @@ discard block |
||
| 332 | 332 | "module" => $module, |
| 333 | 333 | )); |
| 334 | 334 | return $this->writeTemplateToFile($index, |
| 335 | - $modPath . DIRECTORY_SEPARATOR . "Templates" . DIRECTORY_SEPARATOR . "index.html.twig", |
|
| 335 | + $modPath.DIRECTORY_SEPARATOR."Templates".DIRECTORY_SEPARATOR."index.html.twig", |
|
| 336 | 336 | $force); |
| 337 | 337 | } |
| 338 | 338 | |
@@ -362,7 +362,7 @@ discard block |
||
| 362 | 362 | )); |
| 363 | 363 | |
| 364 | 364 | return $this->writeTemplateToFile($controller, |
| 365 | - $modPath . DIRECTORY_SEPARATOR . 'base' . DIRECTORY_SEPARATOR . "{$api}BaseApi.php", true); |
|
| 365 | + $modPath.DIRECTORY_SEPARATOR.'base'.DIRECTORY_SEPARATOR."{$api}BaseApi.php", true); |
|
| 366 | 366 | } |
| 367 | 367 | |
| 368 | 368 | /** |
@@ -387,7 +387,7 @@ discard block |
||
| 387 | 387 | "package" => $package, |
| 388 | 388 | )); |
| 389 | 389 | |
| 390 | - return $this->writeTemplateToFile($controller, $modPath . DIRECTORY_SEPARATOR . "{$api}.php", $force); |
|
| 390 | + return $this->writeTemplateToFile($controller, $modPath.DIRECTORY_SEPARATOR."{$api}.php", $force); |
|
| 391 | 391 | } |
| 392 | 392 | |
| 393 | 393 | /** |
@@ -404,9 +404,9 @@ discard block |
||
| 404 | 404 | $base = $dir->path; |
| 405 | 405 | while ($file = $dir->read()) { |
| 406 | 406 | if (!in_array(strtolower($file), ['.', '..', 'base', 'map'])) { |
| 407 | - if (is_dir($base . DIRECTORY_SEPARATOR . $file)) { |
|
| 408 | - $this->generateApiFiles($module, $force, $apiClass, dir($base . DIRECTORY_SEPARATOR . $file), $apiPath . DIRECTORY_SEPARATOR . $file, $file); |
|
| 409 | - } else if (!preg_match('/Query\.php$/i', $file) |
|
| 407 | + if (is_dir($base.DIRECTORY_SEPARATOR.$file)) { |
|
| 408 | + $this->generateApiFiles($module, $force, $apiClass, dir($base.DIRECTORY_SEPARATOR.$file), $apiPath.DIRECTORY_SEPARATOR.$file, $file); |
|
| 409 | + }else if (!preg_match('/Query\.php$/i', $file) |
|
| 410 | 410 | && !preg_match('/I18n\.php$/i', $file) |
| 411 | 411 | && preg_match('/\.php$/i', $file) |
| 412 | 412 | ) { |
@@ -435,7 +435,7 @@ discard block |
||
| 435 | 435 | $parts[] = $package; |
| 436 | 436 | } |
| 437 | 437 | $parts[] = $filename; |
| 438 | - $namespace = '\\' . implode('\\', $parts); |
|
| 438 | + $namespace = '\\'.implode('\\', $parts); |
|
| 439 | 439 | $reflectorClass = new \ReflectionClass($namespace); |
| 440 | 440 | $isModel = $reflectorClass->isInstantiable(); |
| 441 | 441 | return $isModel; |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | public function init() |
| 55 | 55 | { |
| 56 | 56 | parent::init(); |
| 57 | - Logger::log(static::class . ' init', LOG_DEBUG); |
|
| 57 | + Logger::log(static::class.' init', LOG_DEBUG); |
|
| 58 | 58 | $this->domain = $this->getDomain(); |
| 59 | 59 | $this->hydrateRequestData(); |
| 60 | 60 | $this->hydrateOrders(); |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | } |
| 64 | 64 | $this->checkFieldType(); |
| 65 | 65 | $this->setLoaded(true); |
| 66 | - Logger::log(static::class . ' loaded', LOG_DEBUG); |
|
| 66 | + Logger::log(static::class.' loaded', LOG_DEBUG); |
|
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | private function checkActions($method) |
@@ -159,11 +159,11 @@ discard block |
||
| 159 | 159 | $status = 200; |
| 160 | 160 | $saved = TRUE; |
| 161 | 161 | $model = $this->model->toArray($this->fieldType ?: TableMap::TYPE_PHPNAME, true, [], true); |
| 162 | - } else { |
|
| 162 | + }else { |
|
| 163 | 163 | $message = t('No se ha podido guardar el modelo seleccionado'); |
| 164 | 164 | } |
| 165 | - } catch (\Exception $e) { |
|
| 166 | - $message = t('Ha ocurrido un error intentando guardar el elemento: ') . '<br>' . $e->getMessage(); |
|
| 165 | + }catch (\Exception $e) { |
|
| 166 | + $message = t('Ha ocurrido un error intentando guardar el elemento: ').'<br>'.$e->getMessage(); |
|
| 167 | 167 | $context = []; |
| 168 | 168 | if (null !== $e->getPrevious()) { |
| 169 | 169 | $context[] = $e->getPrevious()->getMessage(); |
@@ -201,10 +201,10 @@ discard block |
||
| 201 | 201 | $updated = TRUE; |
| 202 | 202 | $status = 200; |
| 203 | 203 | $model = $this->model->toArray($this->fieldType ?: TableMap::TYPE_PHPNAME, true, [], true); |
| 204 | - } else { |
|
| 204 | + }else { |
|
| 205 | 205 | $message = t('Ha ocurrido un error intentando actualizar el elemento, por favor revisa los logs'); |
| 206 | 206 | } |
| 207 | - } catch (\Exception $e) { |
|
| 207 | + }catch (\Exception $e) { |
|
| 208 | 208 | $message = t('Ha ocurrido un error intentando actualizar el elemento, por favor revisa los logs'); |
| 209 | 209 | $context = []; |
| 210 | 210 | if (null !== $e->getPrevious()) { |
@@ -212,7 +212,7 @@ discard block |
||
| 212 | 212 | } |
| 213 | 213 | Logger::log($e->getMessage(), LOG_CRIT, $context); |
| 214 | 214 | } |
| 215 | - } else { |
|
| 215 | + }else { |
|
| 216 | 216 | $message = t('No se ha encontrado el modelo al que se hace referencia para actualizar'); |
| 217 | 217 | } |
| 218 | 218 | |
@@ -246,7 +246,7 @@ discard block |
||
| 246 | 246 | $this->model->delete($this->con); |
| 247 | 247 | $deleted = TRUE; |
| 248 | 248 | } |
| 249 | - } catch (\Exception $e) { |
|
| 249 | + }catch (\Exception $e) { |
|
| 250 | 250 | $context = []; |
| 251 | 251 | if (null !== $e->getPrevious()) { |
| 252 | 252 | $context[] = $e->getPrevious()->getMessage(); |
@@ -278,7 +278,7 @@ discard block |
||
| 278 | 278 | $this->saveBulk(); |
| 279 | 279 | $saved = true; |
| 280 | 280 | $status = 200; |
| 281 | - } catch (\Exception $e) { |
|
| 281 | + }catch (\Exception $e) { |
|
| 282 | 282 | Logger::log($e->getMessage(), LOG_CRIT, $this->getRequest()->getData()); |
| 283 | 283 | $message = t('Bulk insert rolled back'); |
| 284 | 284 | } |
@@ -310,7 +310,7 @@ discard block |
||
| 310 | 310 | if (null !== $this->list) { |
| 311 | 311 | if (array_key_exists(self::API_FIELDS_RESULT_FIELD, $this->query) && Config::getParam('api.field.types')) { |
| 312 | 312 | $return = $this->extractDataWithFormat(); |
| 313 | - } else { |
|
| 313 | + }else { |
|
| 314 | 314 | $return = $this->list->toArray(null, false, $this->fieldType ?: TableMap::TYPE_PHPNAME, false); |
| 315 | 315 | } |
| 316 | 316 | $total = 0; |
@@ -323,8 +323,8 @@ discard block |
||
| 323 | 323 | $pages = 1; |
| 324 | 324 | } |
| 325 | 325 | } |
| 326 | - } catch (\Exception $e) { |
|
| 327 | - Logger::log(get_class($this) . ': ' . $e->getMessage(), LOG_ERR); |
|
| 326 | + }catch (\Exception $e) { |
|
| 327 | + Logger::log(get_class($this).': '.$e->getMessage(), LOG_ERR); |
|
| 328 | 328 | } |
| 329 | 329 | |
| 330 | 330 | return array($return, $total, $pages); |
@@ -342,7 +342,7 @@ discard block |
||
| 342 | 342 | $return = array(); |
| 343 | 343 | if (NULL === $model || !method_exists($model, 'toArray')) { |
| 344 | 344 | $code = 404; |
| 345 | - } else { |
|
| 345 | + }else { |
|
| 346 | 346 | $return = $model->toArray($this->fieldType ?: TableMap::TYPE_PHPNAME, true, [], true); |
| 347 | 347 | } |
| 348 | 348 | |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | $vars['__profiling__'] = Inspector::getStats(); |
| 43 | 43 | } |
| 44 | 44 | $domain = (null === $domain) ? $this->getDomain() : $domain; |
| 45 | - return $this->tpl->render($domain . $template, $vars, $cookies); |
|
| 45 | + return $this->tpl->render($domain.$template, $vars, $cookies); |
|
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | /** |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | { |
| 74 | 74 | $vars['__menu__'] = $this->getMenu(); |
| 75 | 75 | $domain = $domain ?: $this->getDomain(); |
| 76 | - return $this->tpl->dump($domain . $template, $vars); |
|
| 76 | + return $this->tpl->dump($domain.$template, $vars); |
|
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | /** |
@@ -98,7 +98,7 @@ |
||
| 98 | 98 | { |
| 99 | 99 | $this->params = []; |
| 100 | 100 | $this->headers = []; |
| 101 | - Logger::log('Context service for ' . static::class . ' cleared!'); |
|
| 101 | + Logger::log('Context service for '.static::class.' cleared!'); |
|
| 102 | 102 | $this->closeConnection(); |
| 103 | 103 | } |
| 104 | 104 | |
@@ -58,11 +58,11 @@ discard block |
||
| 58 | 58 | if ($files->hasResults()) { |
| 59 | 59 | foreach ($files->getIterator() as $file) { |
| 60 | 60 | if ($namespace !== Router::PSFS_BASE_NAMESPACE && method_exists($file, 'getRelativePathname')) { |
| 61 | - $filename = '\\' . str_replace('/', '\\', str_replace($origen, '', $file->getRelativePathname())); |
|
| 62 | - } else { |
|
| 61 | + $filename = '\\'.str_replace('/', '\\', str_replace($origen, '', $file->getRelativePathname())); |
|
| 62 | + }else { |
|
| 63 | 63 | $filename = str_replace('/', '\\', str_replace($origen, '', $file->getPathname())); |
| 64 | 64 | } |
| 65 | - $routing = $this->addRouting($namespace . str_replace('.php', '', $filename), $routing, $namespace); |
|
| 65 | + $routing = $this->addRouting($namespace.str_replace('.php', '', $filename), $routing, $namespace); |
|
| 66 | 66 | } |
| 67 | 67 | } |
| 68 | 68 | $this->initializeFinder(); |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | if (!is_array($this->domains)) { |
| 116 | 116 | $this->domains = []; |
| 117 | 117 | } |
| 118 | - $domain = '@' . $class->getConstant('DOMAIN') . '/'; |
|
| 118 | + $domain = '@'.$class->getConstant('DOMAIN').'/'; |
|
| 119 | 119 | if (!array_key_exists($domain, $this->domains)) { |
| 120 | 120 | $this->domains[$domain] = RouterHelper::extractDomainInfo($class, $domain); |
| 121 | 121 | } |
@@ -142,11 +142,11 @@ discard block |
||
| 142 | 142 | private function loadExternalAutoloader($hydrateRoute, SplFileInfo $modulePath, $externalModulePath, &$routing = []) |
| 143 | 143 | { |
| 144 | 144 | $extModule = $modulePath->getBasename(); |
| 145 | - $moduleAutoloader = realpath($externalModulePath . DIRECTORY_SEPARATOR . $extModule . DIRECTORY_SEPARATOR . 'autoload.php'); |
|
| 145 | + $moduleAutoloader = realpath($externalModulePath.DIRECTORY_SEPARATOR.$extModule.DIRECTORY_SEPARATOR.'autoload.php'); |
|
| 146 | 146 | if (file_exists($moduleAutoloader)) { |
| 147 | 147 | include_once $moduleAutoloader; |
| 148 | 148 | if ($hydrateRoute) { |
| 149 | - $routing = $this->inspectDir($externalModulePath . DIRECTORY_SEPARATOR . $extModule, '\\' . $extModule, $routing); |
|
| 149 | + $routing = $this->inspectDir($externalModulePath.DIRECTORY_SEPARATOR.$extModule, '\\'.$extModule, $routing); |
|
| 150 | 150 | } |
| 151 | 151 | } |
| 152 | 152 | } |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | $modulesToIgnore = explode(',', Config::getParam('hide.modules', '')); |
| 163 | 163 | try { |
| 164 | 164 | $module = preg_replace('/(\\\|\/)/', DIRECTORY_SEPARATOR, $module); |
| 165 | - $externalModulePath = VENDOR_DIR . DIRECTORY_SEPARATOR . $module . DIRECTORY_SEPARATOR . 'src'; |
|
| 165 | + $externalModulePath = VENDOR_DIR.DIRECTORY_SEPARATOR.$module.DIRECTORY_SEPARATOR.'src'; |
|
| 166 | 166 | if (file_exists($externalModulePath)) { |
| 167 | 167 | $externalModule = $this->finder->directories()->in($externalModulePath)->depth(0); |
| 168 | 168 | if ($externalModule->hasResults()) { |
@@ -173,7 +173,7 @@ discard block |
||
| 173 | 173 | } |
| 174 | 174 | } |
| 175 | 175 | } |
| 176 | - } catch (Exception $e) { |
|
| 176 | + }catch (Exception $e) { |
|
| 177 | 177 | Logger::log($e->getMessage(), LOG_WARNING); |
| 178 | 178 | } |
| 179 | 179 | } |
@@ -30,8 +30,8 @@ discard block |
||
| 30 | 30 | public function add($name, array $value = []) |
| 31 | 31 | { |
| 32 | 32 | $this->fields[$name] = $value; |
| 33 | - $this->fields[$name]['name'] = $this->getName() . '[' . $name . ']'; |
|
| 34 | - $this->fields[$name]['id'] = $this->getName() . '_' . $name; |
|
| 33 | + $this->fields[$name]['name'] = $this->getName().'['.$name.']'; |
|
| 34 | + $this->fields[$name]['id'] = $this->getName().'_'.$name; |
|
| 35 | 35 | $this->fields[$name]['placeholder'] = array_key_exists('placeholder', $value) ? $value['placeholder'] : $name; |
| 36 | 36 | $this->fields[$name]['hasLabel'] = array_key_exists('hasLabel', $value) ? $value['hasLabel'] : true; |
| 37 | 37 | return $this; |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | $data = array(); |
| 71 | 71 | if (count($this->fields) > 0) { |
| 72 | 72 | foreach ($this->fields as $key => $field) { |
| 73 | - if (self::SEPARATOR !== $key && $key !== ($this->getName() . '_token')) { |
|
| 73 | + if (self::SEPARATOR !== $key && $key !== ($this->getName().'_token')) { |
|
| 74 | 74 | $data[$key] = array_key_exists('value', $field) ? $field['value'] : null; |
| 75 | 75 | } |
| 76 | 76 | } |
@@ -117,10 +117,10 @@ discard block |
||
| 117 | 117 | if (array_key_exists($key, $data[$formName])) { |
| 118 | 118 | if (preg_match('/id/i', $key) && ($data[$formName][$key] === 0 || $data[$formName][$key] === '%' || $data[$formName][$key] === '')) { |
| 119 | 119 | $field['value'] = null; |
| 120 | - } else { |
|
| 120 | + }else { |
|
| 121 | 121 | $field['value'] = $data[$formName][$key]; |
| 122 | 122 | } |
| 123 | - } else { |
|
| 123 | + }else { |
|
| 124 | 124 | unset($field['value']); |
| 125 | 125 | } |
| 126 | 126 | return array($data, $field); |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | if (array_key_exists('i18n', $behaviors)) { |
| 133 | - $relateI18n = $tableMap->getRelation($tableMap->getPhpName() . 'I18n'); |
|
| 133 | + $relateI18n = $tableMap->getRelation($tableMap->getPhpName().'I18n'); |
|
| 134 | 134 | if (null !== $relateI18n) { |
| 135 | 135 | $i18NTableMap = $relateI18n->getLocalTable(); |
| 136 | 136 | foreach ($i18NTableMap->getColumns() as $columnMap) { |
@@ -173,12 +173,12 @@ discard block |
||
| 173 | 173 | try { |
| 174 | 174 | foreach ($tableMap->getColumns() as $tableMapColumn) { |
| 175 | 175 | $columnName = $tableMapColumn->getPhpName(); |
| 176 | - if (preg_match('/^' . $field . '$/i', $columnName)) { |
|
| 176 | + if (preg_match('/^'.$field.'$/i', $columnName)) { |
|
| 177 | 177 | $column = $tableMapColumn; |
| 178 | 178 | break; |
| 179 | 179 | } |
| 180 | 180 | } |
| 181 | - } catch (\Exception $e) { |
|
| 181 | + }catch (\Exception $e) { |
|
| 182 | 182 | Logger::log($e->getMessage(), LOG_DEBUG); |
| 183 | 183 | } |
| 184 | 184 | return $column; |