Skip to content

Commit

Permalink
[console] Tag new version 1.0.0-beta3. (#2475)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmolivas authored Jun 29, 2016
1 parent 4060c6c commit e1be5a7
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 47 deletions.
2 changes: 1 addition & 1 deletion src/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class Application extends BaseApplication
/**
* @var string
*/
const VERSION = '1.0.0-beta2';
const VERSION = '1.0.0-beta3';

/**
* @var string
Expand Down
4 changes: 2 additions & 2 deletions src/Command/Generate/ControllerCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ function ($method) use ($routes) {
sprintf('/%s/hello/{name}', $module),
function ($path) use ($routes) {
$routeProvider = $this->getRouteProvider();
if (count($routeProvider->getRoutesByPattern($path)) > 0
if (count($routeProvider->getRoutesByPattern($path)) > 0
|| in_array($path, array_column($routes, 'path'))
) {
throw new \InvalidArgumentException(
Expand All @@ -204,7 +204,7 @@ function ($path) use ($routes) {
$classMachineName = $this->getStringHelper()->camelCaseToMachineName($class);
$routeName = $module . '.' . $classMachineName . '_' . $method;
$routeProvider = $this->getRouteProvider();
if ($routeProvider->getRoutesByNames([$routeName])
if ($routeProvider->getRoutesByNames([$routeName])
|| in_array($routeName, $routes)
) {
$routeName .= '_' . rand(0, 100);
Expand Down
70 changes: 32 additions & 38 deletions src/Command/Module/DebugCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,25 +22,25 @@ class DebugCommand extends Command
protected function configure()
{
$this
->setName('module:debug')
->setDescription($this->trans('commands.module.debug.description'))
->addArgument(
'module',
InputArgument::OPTIONAL | InputArgument::IS_ARRAY,
$this->trans('commands.module.debug.module')
)
->addOption(
'status',
NULL,
InputOption::VALUE_OPTIONAL,
$this->trans('commands.module.debug.options.status')
)
->addOption(
'type',
NULL,
InputOption::VALUE_OPTIONAL,
$this->trans('commands.module.debug.options.type')
);
->setName('module:debug')
->setDescription($this->trans('commands.module.debug.description'))
->addArgument(
'module',
InputArgument::OPTIONAL | InputArgument::IS_ARRAY,
$this->trans('commands.module.debug.module')
)
->addOption(
'status',
null,
InputOption::VALUE_OPTIONAL,
$this->trans('commands.module.debug.options.status')
)
->addOption(
'type',
null,
InputOption::VALUE_OPTIONAL,
$this->trans('commands.module.debug.options.type')
);
}

protected function execute(InputInterface $input, OutputInterface $output)
Expand All @@ -59,20 +59,19 @@ protected function execute(InputInterface $input, OutputInterface $output)

foreach ($modules as $module) {
$url = sprintf(
'%s/packages/drupal/%s.json',
$config->get('application.composer.packages.default'),
$module
'%s/packages/drupal/%s.json',
$config->get('application.composer.packages.default'),
$module
);

try {
$data = $this->getApplication()->getHttpClientHelper()->getUrlAsJson($repo . $url);

} catch (\Exception $e) {
$io->error(
sprintf(
$this->trans('commands.module.debug.messages.no-results'),
$module
)
sprintf(
$this->trans('commands.module.debug.messages.no-results'),
$module
)
);

return 1;
Expand Down Expand Up @@ -110,22 +109,18 @@ protected function execute(InputInterface $input, OutputInterface $output)

if ($status == 'installed') {
$status = 1;
}
elseif ($status == 'uninstalled') {
} elseif ($status == 'uninstalled') {
$status = 0;
}
else {
} else {
$status = -1;
}

if ($type == 'core') {
$type = 'core';
}
elseif ($type == 'no-core') {
} elseif ($type == 'no-core') {
$type = '';
}
else {
$type = NULL;
} else {
$type = null;
}

$tableHeader = [
Expand All @@ -145,7 +140,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
continue;
}

if ($type !== NULL && $type !== $module->origin) {
if ($type !== null && $type !== $module->origin) {
continue;
}

Expand All @@ -166,5 +161,4 @@ protected function execute(InputInterface $input, OutputInterface $output)

$io->table($tableHeader, $tableRows, 'compact');
}

}
11 changes: 5 additions & 6 deletions src/Generator/BreakPointGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class BreakPointGenerator extends Generator
* @param $breakpoints
* @param $machine_name
*/
public function generate($theme,$breakpoints,$machine_name)
public function generate($theme, $breakpoints, $machine_name)
{
$parameters = [
'theme' => $theme,
Expand All @@ -27,11 +27,10 @@ public function generate($theme,$breakpoints,$machine_name)
$theme_path = $this->getSite()->getThemePath($theme);

$this->renderFile(
'theme/breakpoints.yml.twig',
$theme_path .'/'.$machine_name.'.breakpoints.yml',
$parameters,
FILE_APPEND
'theme/breakpoints.yml.twig',
$theme_path .'/'.$machine_name.'.breakpoints.yml',
$parameters,
FILE_APPEND
);

}
}

0 comments on commit e1be5a7

Please sign in to comment.