Skip to content

Commit

Permalink
[console] Apply PSR-2 code style. (#3024)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmolivas authored Dec 18, 2016
1 parent 370a57d commit 0f388ef
Show file tree
Hide file tree
Showing 148 changed files with 1,780 additions and 1,554 deletions.
1 change: 0 additions & 1 deletion src/Annotations/DrupalCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,4 @@ class DrupalCommand
* @var array
*/
public $dependencies;

}
6 changes: 3 additions & 3 deletions src/Annotations/DrupalCommandAnnotationReader.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
* Class DrupalCommandReader
* @package Drupal\Console\Annotations
*/
class DrupalCommandAnnotationReader {

class DrupalCommandAnnotationReader
{
/**
* @param $class
* @return array
Expand All @@ -22,7 +22,7 @@ public function readAnnotation($class)
new \ReflectionClass($class),
'Drupal\\Console\\Annotations\\DrupalCommand'
);
if($drupalCommandAnnotation) {
if ($drupalCommandAnnotation) {
$annotation['extension'] = $drupalCommandAnnotation->extension?:'';
$annotation['extensionType'] = $drupalCommandAnnotation->extensionType?:'';
$annotation['dependencies'] = $drupalCommandAnnotation->dependencies?:[];
Expand Down
3 changes: 2 additions & 1 deletion src/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,8 @@ private function commandData($commandName)
return $data;
}

public function setContainer($container) {
public function setContainer($container)
{
$this->container = $container;
$this->registerGenerators();
$this->registerCommands();
Expand Down
19 changes: 9 additions & 10 deletions src/Bootstrap/Drupal.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,17 @@ public function boot()

$argvInputReader = new ArgvInputReader();
if ($argvInputReader->get('uri')) {
$uri = $argvInputReader->get('uri');
if (substr($uri, -1) != '/') {
$uri .= '/';
}
$uri .= 'index.php';
$request = Request::create($uri, 'GET', array() , array(), array(), array('SCRIPT_NAME' => $this->appRoot . '/index.php'));
}
else {
$request = Request::createFromGlobals();
$uri = $argvInputReader->get('uri');
if (substr($uri, -1) != '/') {
$uri .= '/';
}
$uri .= 'index.php';
$request = Request::create($uri, 'GET', array(), array(), array(), array('SCRIPT_NAME' => $this->appRoot . '/index.php'));
} else {
$request = Request::createFromGlobals();
}

$drupalKernel = DrupalKernel::createFromRequest (
$drupalKernel = DrupalKernel::createFromRequest(
$request,
$this->autoload,
'prod',
Expand Down
8 changes: 6 additions & 2 deletions src/Command/Config/DebugCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,14 @@ class DebugCommand extends Command
{
use CommandTrait;

/** @var ConfigFactory */
/**
* @var ConfigFactory
*/
protected $configFactory;

/** @var CachedStorage */
/**
* @var CachedStorage
*/
protected $configStorage;

/**
Expand Down
14 changes: 10 additions & 4 deletions src/Command/Config/DeleteCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,19 @@ class DeleteCommand extends Command

protected $allConfig = [];

/** @var ConfigFactory */
/**
* @var ConfigFactory
*/
protected $configFactory;

/** @var CachedStorage */
/**
* @var CachedStorage
*/
protected $configStorage;

/** @var FileStorage */
/**
* @var FileStorage
*/
protected $configStorageSync;

/**
Expand All @@ -39,7 +45,7 @@ class DeleteCommand extends Command
* @param FileStorage $configStorageSync
*/
public function __construct(
ConfigFactory $configFactory ,
ConfigFactory $configFactory,
CachedStorage $configStorage,
FileStorage $configStorageSync
) {
Expand Down
8 changes: 6 additions & 2 deletions src/Command/Config/DiffCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,14 @@ class DiffCommand extends Command
{
use CommandTrait;

/** @var CachedStorage */
/**
* @var CachedStorage
*/
protected $configStorage;

/** @var ConfigManager */
/**
* @var ConfigManager
*/
protected $configManager;

/**
Expand Down
20 changes: 13 additions & 7 deletions src/Command/Config/EditCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,29 @@ class EditCommand extends Command
{
use CommandTrait;

/** @var ConfigFactory */
/**
* @var ConfigFactory
*/
protected $configFactory;

/** @var CachedStorage */
/**
* @var CachedStorage
*/
protected $configStorage;

/** @var ConfigurationManager */
/**
* @var ConfigurationManager
*/
protected $configurationManager;

/**
* EditCommand constructor.
* @param ConfigFactory $configFactory
* @param CachedStorage $configStorage
* @param ConfigurationManager $configurationManager
* @param ConfigFactory $configFactory
* @param CachedStorage $configStorage
* @param ConfigurationManager $configurationManager
*/
public function __construct(
ConfigFactory $configFactory ,
ConfigFactory $configFactory,
CachedStorage $configStorage,
ConfigurationManager $configurationManager
) {
Expand Down
14 changes: 8 additions & 6 deletions src/Command/Config/ExportCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,21 @@
use Drupal\Console\Style\DrupalStyle;
use Drupal\Core\Config\ConfigManager;


class ExportCommand extends Command
{
use CommandTrait;

/** @var ConfigManager */
/**
* @var ConfigManager
*/
protected $configManager;

/**
* ExportCommand constructor.
* @param ConfigManager $configManager
*/
public function __construct(ConfigManager $configManager ) {
public function __construct(ConfigManager $configManager)
{
$this->configManager = $configManager;
parent::__construct();
}
Expand Down Expand Up @@ -142,9 +144,9 @@ protected function execute(InputInterface $input, OutputInterface $output)
}

$io->info(
sprintf(
$this->trans('commands.config.export.messages.directory'),
$directory
sprintf(
$this->trans('commands.config.export.messages.directory'),
$directory
)
);
}
Expand Down
18 changes: 12 additions & 6 deletions src/Command/Config/ExportContentTypeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,28 @@ class ExportContentTypeCommand extends Command
use ModuleTrait;
use ExportTrait;

/** @var EntityTypeManager */
/**
* @var EntityTypeManagerInterface
*/
protected $entityTypeManager;

/** @var CachedStorage */
/**
* @var CachedStorage
*/
protected $configStorage;

/** @var Manager */
/**
* @var Manager
*/
protected $extensionManager;

protected $configExport;

/**
* ExportContentTypeCommand constructor.
* @param EntityTypeManagerInterface $entityTypeManager
* @param CachedStorage $configStorage
* @param Manager $extensionManager
* @param CachedStorage $configStorage
* @param Manager $extensionManager
*/
public function __construct(
EntityTypeManagerInterface $entityTypeManager,
Expand Down Expand Up @@ -199,4 +205,4 @@ protected function getViewDisplays($contentType, $optional = false)
}
}
}
}
}
Loading

0 comments on commit 0f388ef

Please sign in to comment.