Skip to content

Commit

Permalink
LCH-6143: Fix static linting errors. (#49)
Browse files Browse the repository at this point in the history
* Fix static linting errors.

* Fix static linting function docs and variable docs.

* Fix last error
  • Loading branch information
amangrover90 authored Aug 30, 2022
1 parent 19f66ee commit 13763f8
Show file tree
Hide file tree
Showing 58 changed files with 619 additions and 185 deletions.
7 changes: 4 additions & 3 deletions src/Command/PlatformBootStrapCommandInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace EclipseGc\CommonConsole\Command;

/**
* Interface PlatformBootStrapCommandInterface
* Interface PlatformBootStrapCommandInterface.
*
* @package EclipseGc\CommonConsole\EventSubscriber\ConsoleCommand
*/
Expand All @@ -17,7 +17,8 @@ interface PlatformBootStrapCommandInterface {
* bootstrap requirement and react accordingly.
*
* @return string
* Platform bootstrap.
*/
public function getPlatformBootstrapType() : string ;
public function getPlatformBootstrapType() : string;

}
}
2 changes: 1 addition & 1 deletion src/Command/PlatformCreate.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
use Symfony\Component\EventDispatcher\EventDispatcherInterface;

/**
* Class CreatePlatform
* Class CreatePlatform.
*
* @package EclipseGc\CommonConsole\Command
*/
Expand Down
4 changes: 2 additions & 2 deletions src/Command/PlatformDelete.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* @package EclipseGc\CommonConsole\Command
*/
class PlatformDelete extends Command {

/**
* {@inheritdoc}
*/
Expand All @@ -33,7 +33,7 @@ class PlatformDelete extends Command {
*
* @param \EclipseGc\CommonConsole\Platform\PlatformStorage $storage
* The platform storage service.
* @param string|NULL $name
* @param string|null $name
* The name of this command.
*/
public function __construct(PlatformStorage $storage, string $name = NULL) {
Expand Down
7 changes: 4 additions & 3 deletions src/Command/PlatformEdit.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@

use Symfony\Component\Console\Command\Command;

/**
* PlatformEdit.
*/
class PlatformEdit extends Command {

/**
* {@inheritdoc}
*/
protected static $defaultName = 'platform:edit';



}
}
4 changes: 2 additions & 2 deletions src/Command/PlatformList.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,14 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$output->writeln('No platform available.');
return 0;
}

$table = new Table($output);
$table->setHeaders(['Alias', 'Type']);
foreach ($aliases as $platform) {
$table->addRow([$platform->getAlias(), $platform->get('platform.type')]);
}
$table->render();

return 0;
}

Expand Down
8 changes: 7 additions & 1 deletion src/Command/PlatformSites.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ class PlatformSites extends Command implements PlatformCommandInterface {
*/
protected static $defaultName = 'platform:sites';

/**
* PlatformSites constructor.
*/
public function __construct(EventDispatcherInterface $dispatcher, string $name = NULL) {
$this->dispatcher = $dispatcher;
parent::__construct($name);
Expand All @@ -36,9 +39,12 @@ protected function configure() {
$this->setDescription('List available sites registered in the platform.');
}

/**
* Return expected platform options.
*/
public static function getExpectedPlatformOptions(): array {
return [
'source' => '\EclipseGc\CommonConsole\Platform\PlatformSitesInterface'
'source' => '\EclipseGc\CommonConsole\Platform\PlatformSitesInterface',
];
}

Expand Down
4 changes: 2 additions & 2 deletions src/Command/Traits/OptionsCheckerTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ protected function checkRequiredOptions(array $options, InputInterface $input):
return;
}

throw new \Exception(sprintf('Missing required option(s): %s', join(', ', $missing_options)));
throw new \Exception(sprintf('Missing required option(s): %s', implode(', ', $missing_options)));
}

}
12 changes: 9 additions & 3 deletions src/CommandCompilerPass.php
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
<?php

namespace EclipseGc\CommonConsole;

use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjection\Reference;

/**
* Compiler pass for commonconsole commands.
*/
class CommandCompilerPass implements CompilerPassInterface {

public const SERVICE_NAME = 'common_console_application';

public function process(ContainerBuilder $container)
{
/**
* {@inheritDoc}
*/
public function process(ContainerBuilder $container) {
if (!$container->has(self::SERVICE_NAME)) {
return;
}
Expand All @@ -24,7 +30,7 @@ public function process(ContainerBuilder $container)
foreach ($taggedServices as $id => $tags) {
$definition->addMethodCall(
'add',
array(new Reference($id))
[new Reference($id)]
);
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/CommandQuestionInterface.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
<?php


namespace EclipseGc\CommonConsole;

/**
* Interface CommandQuestionInterface
* Interface CommandQuestionInterface.
*
* @package EclipseGc\CommonConsole
*/
Expand Down Expand Up @@ -33,6 +32,7 @@ interface CommandQuestionInterface {
* public static function getRemoteVendorDir(array $values) {...
*
* @return array
* Question list.
*/
public static function getQuestions();

Expand Down
5 changes: 4 additions & 1 deletion src/CommonConsoleEvents.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

namespace EclipseGc\CommonConsole;

/**
* Event classes.
*/
final class CommonConsoleEvents {

const ALIAS_FIND = 'commonconsole.alias.find';
Expand Down Expand Up @@ -30,7 +33,7 @@ final class CommonConsoleEvents {
const PLATFORM_ARGS_INJ = 'commonconsole.platform.argument.injection';

const FILTER_PLATFORM_SITES = 'commonconsole.platform.sites.filter';

const PLATFORM_CONFIG = 'commonconsole.platform.config';

}
7 changes: 6 additions & 1 deletion src/Config/ConfigStorage.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@
use Symfony\Component\Yaml\Yaml;

/**
* Class ConfigStorage
* Class ConfigStorage.
*
* @package EclipseGc\CommonConsole\Config
*/
class ConfigStorage {

/**
* File system.
*
* @var \Symfony\Component\Filesystem\Filesystem
*/
protected $filesystem;
Expand All @@ -23,6 +25,7 @@ class ConfigStorage {
* ConfigStorage constructor.
*
* @param \Symfony\Component\Filesystem\Filesystem $filesystem
* File system.
*/
public function __construct(Filesystem $filesystem) {
$this->filesystem = $filesystem;
Expand Down Expand Up @@ -71,6 +74,7 @@ protected function ensureDirectory(array $dir_parts): string {
* Config name.
*
* @return bool
* True if file exists, false otherwise.
*/
public function configExists(array $dir_parts, string $name): bool {
$path = $this->ensureDirectory($dir_parts);
Expand All @@ -88,6 +92,7 @@ public function configExists(array $dir_parts, string $name): bool {
*
* @return \Consolidation\Config\Config
* Config object.
*
* @throws \Exception
*/
public function load(string $name, array $dir_parts): Config {
Expand Down
20 changes: 19 additions & 1 deletion src/Event/AddPlatformToCommandEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use Symfony\Contracts\EventDispatcher\Event;

/**
* Class AddPlatformToCommandEvent
* Class AddPlatformToCommandEvent.
*
* @package EclipseGc\CommonConsole\Event
*/
Expand Down Expand Up @@ -50,8 +50,11 @@ class AddPlatformToCommandEvent extends Event {
* AddPlatformToCommandEvent constructor.
*
* @param string $expectation
* Expectation string.
* @param \EclipseGc\CommonConsole\PlatformInterface $platform
* Platform object.
* @param string $alias
* Platform alias.
*/
public function __construct(string $expectation, PlatformInterface $platform, string $alias) {
$this->expectation = $expectation;
Expand All @@ -60,35 +63,50 @@ public function __construct(string $expectation, PlatformInterface $platform, st
}

/**
* Returns expectation.
*
* @return string
* Expectation.
*/
public function getExpectation(): string {
return $this->expectation;
}

/**
* Returns platform.
*
* @return \EclipseGc\CommonConsole\PlatformInterface
* Returns platform.
*/
public function getPlatform(): PlatformInterface {
return $this->platform;
}

/**
* Returns alias.
*
* @return string
* Platform alias.
*/
public function getAlias(): string {
return $this->alias;
}

/**
* Sets expectation match flag.
*
* @param bool $value
* True or false expectation value.
*/
public function setPlatformExpectationMatch(bool $value): void {
$this->platformMatchesExpectation = $value;
}

/**
* Returns expectation match.
*
* @return bool
* Expectation match flag.
*/
public function platformMatchesExpectation(): bool {
return $this->platformMatchesExpectation;
Expand Down
10 changes: 6 additions & 4 deletions src/Event/BootstrapEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use Symfony\Contracts\EventDispatcher\Event;

/**
* Class BootstrapEvent
* Class BootstrapEvent.
*
* @package EclipseGc\CommonConsole\Event
*/
Expand All @@ -22,7 +22,7 @@ class BootstrapEvent extends Event {
/**
* The console command event which spawned this bootstrap.
*
* @var ConsoleCommandEvent
* @var \Symfony\Component\Console\Event\ConsoleCommandEvent
*/
protected $consoleCommandEvent;

Expand All @@ -31,7 +31,7 @@ class BootstrapEvent extends Event {
*
* @param string $platformType
* The platform type.
* @param ConsoleCommandEvent $event
* @param \Symfony\Component\Console\Event\ConsoleCommandEvent $event
* The console command event.
*/
public function __construct(string $platformType, ConsoleCommandEvent $event) {
Expand All @@ -43,6 +43,7 @@ public function __construct(string $platformType, ConsoleCommandEvent $event) {
* Gets the string representing the platform type.
*
* @return string
* Platform type.
*/
public function getPlatformType(): string {
return $this->platformType;
Expand All @@ -51,7 +52,8 @@ public function getPlatformType(): string {
/**
* Gets the console command event.
*
* @return ConsoleCommandEvent
* @return \Symfony\Component\Console\Event\ConsoleCommandEvent
* Event object.
*/
public function getConsoleCommandEvent(): ConsoleCommandEvent {
return $this->consoleCommandEvent;
Expand Down
8 changes: 8 additions & 0 deletions src/Event/CreateApplicationEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,14 @@
use Symfony\Component\Console\Application;
use Symfony\Contracts\EventDispatcher\Event;

/**
* CreateApplicationEvent.
*/
class CreateApplicationEvent extends Event {

/**
* Console application.
*
* @var \Symfony\Component\Console\Application
*/
protected $application;
Expand All @@ -23,7 +28,10 @@ public function __construct(Application $application) {
}

/**
* Returns application.
*
* @return \Symfony\Component\Console\Application
* Application.
*/
public function getApplication(): Application {
return $this->application;
Expand Down
Loading

0 comments on commit 13763f8

Please sign in to comment.