Skip to content

Commit

Permalink
adjust CS
Browse files Browse the repository at this point in the history
  • Loading branch information
LordSimal committed Jul 12, 2023
1 parent b7142c8 commit 1eb6b23
Show file tree
Hide file tree
Showing 51 changed files with 195 additions and 1 deletion.
1 change: 1 addition & 0 deletions phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<rule ref="PSR1.Classes.ClassDeclaration.MissingNamespace">
<exclude-pattern>*/config/Migrations/*</exclude-pattern>
</rule>
<rule ref="Spryker.Commenting.DocBlockTagGrouping"/>
<rule ref="Spryker.Classes.ClassFileName.NoMatch">
<exclude-pattern>*/config/Migrations/*</exclude-pattern>
</rule>
Expand Down
1 change: 1 addition & 0 deletions src/Command/AddCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public function getOptionParser(): ConsoleOptionParser {
/**
* @param \Cake\Console\Arguments $args Arguments
* @param \Cake\Console\ConsoleIo $io ConsoleIo
*
* @return null|void
*/
public function execute(Arguments $args, ConsoleIo $io) {
Expand Down
5 changes: 4 additions & 1 deletion src/Command/BakeQueueTaskCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ public function bake(string $name, Arguments $args, ConsoleIo $io): void {
* @param string $name The class to bake a test for.
* @param \Cake\Console\Arguments $args The console arguments
* @param \Cake\Console\ConsoleIo $io The console io
*
* @return void
*/
public function bakeTest(string $name, Arguments $args, ConsoleIo $io): void {
Expand All @@ -72,6 +73,7 @@ public function bakeTest(string $name, Arguments $args, ConsoleIo $io): void {
/**
* @param string $name
* @param string $namespace
*
* @return string
*/
protected function generateTaskTestContent(string $name, string $namespace): string {
Expand Down Expand Up @@ -159,7 +161,7 @@ public function templateData(Arguments $arguments): array {
'plugin' => $this->plugin,
'pluginPath' => $pluginPath,
'namespace' => $namespace,
'subNamespace' => $namespacePart ? $namespacePart . '/' : '',
'subNamespace' => $namespacePart ? ($namespacePart . '/') : '',
'name' => $name,
'add' => $arguments->getOption('add'),
];
Expand All @@ -183,6 +185,7 @@ public function fileName(string $name): string {
* Gets the option parser instance and configures it.
*
* @param \Cake\Console\ConsoleOptionParser $parser Parser instance
*
* @return \Cake\Console\ConsoleOptionParser
*/
public function buildOptionParser(ConsoleOptionParser $parser): ConsoleOptionParser {
Expand Down
1 change: 1 addition & 0 deletions src/Command/InfoCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public function getOptionParser(): ConsoleOptionParser {
/**
* @param \Cake\Console\Arguments $args Arguments
* @param \Cake\Console\ConsoleIo $io ConsoleIo
*
* @return null|void
*/
public function execute(Arguments $args, ConsoleIo $io) {
Expand Down
10 changes: 10 additions & 0 deletions src/Command/JobCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ public function getOptionParser(): ConsoleOptionParser {
/**
* @param \Cake\Console\Arguments $args Arguments
* @param \Cake\Console\ConsoleIo $io ConsoleIo
*
* @return int|null
*/
public function execute(Arguments $args, ConsoleIo $io): int|null {
Expand Down Expand Up @@ -129,6 +130,7 @@ public function execute(Arguments $args, ConsoleIo $io): int|null {

/**
* @param \Cake\Console\ConsoleIo $io
*
* @return int
*/
protected function rerunAll(ConsoleIo $io): int {
Expand All @@ -148,6 +150,7 @@ protected function rerunAll(ConsoleIo $io): int {

/**
* @param \Cake\Console\ConsoleIo $io
*
* @return int
*/
protected function resetAll(ConsoleIo $io): int {
Expand All @@ -167,6 +170,7 @@ protected function resetAll(ConsoleIo $io): int {

/**
* @param \Cake\Console\ConsoleIo $io
*
* @return int
*/
protected function removeAll(ConsoleIo $io): int {
Expand All @@ -184,6 +188,7 @@ protected function removeAll(ConsoleIo $io): int {
/**
* @param \Cake\Console\ConsoleIo $io
* @param \Queue\Model\Entity\QueuedJob $queuedJob
*
* @return int
*/
protected function rerun(ConsoleIo $io, QueuedJob $queuedJob): int {
Expand All @@ -203,6 +208,7 @@ protected function rerun(ConsoleIo $io, QueuedJob $queuedJob): int {
/**
* @param \Cake\Console\ConsoleIo $io
* @param \Queue\Model\Entity\QueuedJob $queuedJob
*
* @return int
*/
protected function reset(ConsoleIo $io, QueuedJob $queuedJob): int {
Expand All @@ -222,6 +228,7 @@ protected function reset(ConsoleIo $io, QueuedJob $queuedJob): int {
/**
* @param \Cake\Console\ConsoleIo $io
* @param \Queue\Model\Entity\QueuedJob $queuedJob
*
* @return int
*/
protected function remove(ConsoleIo $io, QueuedJob $queuedJob): int {
Expand All @@ -235,6 +242,7 @@ protected function remove(ConsoleIo $io, QueuedJob $queuedJob): int {
/**
* @param \Cake\Console\ConsoleIo $io
* @param \Queue\Model\Entity\QueuedJob $queuedJob
*
* @return int
*/
protected function view(ConsoleIo $io, QueuedJob $queuedJob): int {
Expand All @@ -260,6 +268,7 @@ protected function view(ConsoleIo $io, QueuedJob $queuedJob): int {

/**
* @param \Cake\Console\ConsoleIo $io
*
* @return int
*/
protected function flush(ConsoleIo $io): int {
Expand All @@ -271,6 +280,7 @@ protected function flush(ConsoleIo $io): int {

/**
* @param \Cake\Console\ConsoleIo $io
*
* @return int
*/
protected function clean(ConsoleIo $io): int {
Expand Down
4 changes: 4 additions & 0 deletions src/Command/MigrateTasksCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ public function getOptionParser(): ConsoleOptionParser {
/**
* @param \Cake\Console\Arguments $args Arguments
* @param \Cake\Console\ConsoleIo $io ConsoleIo
*
* @return null|void
*/
public function execute(Arguments $args, ConsoleIo $io) {
Expand Down Expand Up @@ -125,6 +126,7 @@ public function execute(Arguments $args, ConsoleIo $io) {
* @param string|null $plugin
* @param string $oldPath
* @param string $newPath
*
* @return void
*/
protected function migrateTask(string $name, ?string $plugin, string $oldPath, string $newPath): void {
Expand Down Expand Up @@ -184,6 +186,7 @@ protected function migrateTask(string $name, ?string $plugin, string $oldPath, s
* @param string|null $plugin
* @param string $oldPath
* @param string $newPath
*
* @return void
*/
protected function migrateTaskTest(string $name, ?string $plugin, string $oldPath, string $newPath): void {
Expand Down Expand Up @@ -226,6 +229,7 @@ protected function migrateTaskTest(string $name, ?string $plugin, string $oldPat

/**
* @param string|null $plugin
*
* @return array<string>
*/
protected function getTasks(?string $plugin): array {
Expand Down
2 changes: 2 additions & 0 deletions src/Command/RunCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ public function getOptionParser(): ConsoleOptionParser {

/**
* @param \Cake\Console\Arguments $args Arguments
*
* @return \Psr\Log\LoggerInterface
*/
protected function getLogger(Arguments $args): LoggerInterface {
Expand All @@ -100,6 +101,7 @@ protected function getLogger(Arguments $args): LoggerInterface {
*
* @param \Cake\Console\Arguments $args Arguments
* @param \Cake\Console\ConsoleIo $io ConsoleIo
*
* @return int
*/
public function execute(Arguments $args, ConsoleIo $io): int {
Expand Down
4 changes: 4 additions & 0 deletions src/Command/WorkerCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ public function getOptionParser(): ConsoleOptionParser {
/**
* @param \Cake\Console\Arguments $args Arguments
* @param \Cake\Console\ConsoleIo $io ConsoleIo
*
* @return int|null
*/
public function execute(Arguments $args, ConsoleIo $io): int|null {
Expand Down Expand Up @@ -110,6 +111,7 @@ public function execute(Arguments $args, ConsoleIo $io): int|null {
/**
* @param \Cake\Console\ConsoleIo $io
* @param string $pid
*
* @return int
*/
protected function end(ConsoleIo $io, string $pid): int {
Expand Down Expand Up @@ -139,6 +141,7 @@ protected function end(ConsoleIo $io, string $pid): int {
/**
* @param \Cake\Console\ConsoleIo $io
* @param string $pid
*
* @return int
*/
protected function kill(ConsoleIo $io, string $pid): int {
Expand Down Expand Up @@ -180,6 +183,7 @@ protected function kill(ConsoleIo $io, string $pid): int {

/**
* @param \Cake\Console\ConsoleIo $io
*
* @return int
*/
protected function clean(ConsoleIo $io): int {
Expand Down
22 changes: 22 additions & 0 deletions src/Console/Io.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public function __construct(ConsoleIo $io) {
*
* @param array<string>|string $message A string or an array of strings to output
* @param int $newlines Number of newlines to append
*
* @return int|null The number of bytes returned from writing to stdout.
*/
public function verbose(array|string $message, int $newlines = 1): ?int {
Expand All @@ -41,6 +42,7 @@ public function verbose(array|string $message, int $newlines = 1): ?int {
*
* @param array<string>|string $message A string or an array of strings to output
* @param int $newlines Number of newlines to append
*
* @return int|null The number of bytes returned from writing to stdout.
*/
public function quiet(array|string $message, int $newlines = 1): ?int {
Expand All @@ -59,9 +61,11 @@ public function quiet(array|string $message, int $newlines = 1): ?int {
* While using ConsoleIo::VERBOSE means it will only display when verbose output is toggled.
*
* @link https://book.cakephp.org/4/en/console-commands/input-output.html#creating-output
*
* @param array<string>|string $message A string or an array of strings to output
* @param int $newlines Number of newlines to append
* @param int $level The message's output level, see above.
*
* @return int|null The number of bytes returned from writing to stdout.
*/
public function out(array|string $message = '', int $newlines = 1, int $level = ConsoleIo::NORMAL): ?int {
Expand All @@ -74,6 +78,7 @@ public function out(array|string $message = '', int $newlines = 1, int $level =
*
* @param array<string>|string $message A string or an array of strings to output
* @param int $newlines Number of newlines to append
*
* @return int|null The number of bytes returned from writing to stderr.
*/
public function err(array|string $message = '', int $newlines = 1): ?int {
Expand All @@ -89,9 +94,11 @@ public function err(array|string $message = '', int $newlines = 1): ?int {
* Convenience method for out() that wraps message between <info /> tag
*
* @see https://book.cakephp.org/4/en/console-commands/input-output.html#creating-output
*
* @param array<string>|string $message A string or an array of strings to output
* @param int $newlines Number of newlines to append
* @param int $level The message's output level, see above.
*
* @return int|null The number of bytes returned from writing to stdout.
*/
public function info(array|string $message = '', int $newlines = 1, int $level = ConsoleIo::NORMAL): ?int {
Expand All @@ -107,9 +114,11 @@ public function info(array|string $message = '', int $newlines = 1, int $level =
* Convenience method for out() that wraps message between <comment /> tag
*
* @see https://book.cakephp.org/4/en/console-commands/input-output.html#creating-output
*
* @param array<string>|string $message A string or an array of strings to output
* @param int $newlines Number of newlines to append
* @param int $level The message's output level, see above.
*
* @return int|null The number of bytes returned from writing to stdout.
*/
public function comment(array|string $message = '', int $newlines = 1, int $level = ConsoleIo::NORMAL): ?int {
Expand All @@ -125,8 +134,10 @@ public function comment(array|string $message = '', int $newlines = 1, int $leve
* Convenience method for err() that wraps message between <warning /> tag
*
* @see https://book.cakephp.org/4/en/console-commands/input-output.html#creating-output
*
* @param array<string>|string $message A string or an array of strings to output
* @param int $newlines Number of newlines to append
*
* @return int|null The number of bytes returned from writing to stderr.
*/
public function warn(array|string $message = '', int $newlines = 1): ?int {
Expand All @@ -142,9 +153,11 @@ public function warn(array|string $message = '', int $newlines = 1): ?int {
* Convenience method for out() that wraps message between <success /> tag
*
* @see https://book.cakephp.org/4/en/console-commands/input-output.html#creating-output
*
* @param array<string>|string $message A string or an array of strings to output
* @param int $newlines Number of newlines to append
* @param int $level The message's output level, see above.
*
* @return int|null The number of bytes returned from writing to stdout.
*/
public function success(array|string $message = '', int $newlines = 1, int $level = ConsoleIo::NORMAL): ?int {
Expand All @@ -160,7 +173,9 @@ public function success(array|string $message = '', int $newlines = 1, int $leve
* Returns a single or multiple linefeeds sequences.
*
* @link https://book.cakephp.org/4/en/console-commands/input-output.html#creating-output
*
* @param int $multiplier Number of times the linefeed sequence should be repeated
*
* @return string
*/
public function nl(int $multiplier = 1): string {
Expand All @@ -171,8 +186,10 @@ public function nl(int $multiplier = 1): string {
* Outputs a series of minus characters to the standard output, acts as a visual separator.
*
* @link https://book.cakephp.org/4/en/console-commands/input-output.html#creating-output
*
* @param int $newlines Number of newlines to pre- and append
* @param int $width Width of the line, defaults to 63
*
* @return void
*/
public function hr(int $newlines = 0, int $width = 63): void {
Expand All @@ -184,9 +201,12 @@ public function hr(int $newlines = 0, int $width = 63): void {
* and exits the application with status code 1
*
* @link https://book.cakephp.org/4/en/console-commands/input-output.html#styling-output
*
* @param string $message The error message
* @param int $exitCode The exit code for the shell task.
*
* @throws \Cake\Console\Exception\StopException
*
* @return void
*/
public function abort(string $message, int $exitCode = CommandInterface::CODE_ERROR): void {
Expand All @@ -201,6 +221,7 @@ public function abort(string $message, int $exitCode = CommandInterface::CODE_ER
*
* @param string $name The name of the helper to render
* @param array<string, mixed> $settings Configuration data for the helper.
*
* @return \Cake\Console\Helper The created helper instance.
*/
public function helper(string $name, array $settings = []): Helper {
Expand All @@ -219,6 +240,7 @@ public function helper(string $name, array $settings = []): Helper {
* @param int $newlines Number of newlines to append.
* @param int|null $size The number of bytes to overwrite. Defaults to the
* length of the last message output.
*
* @return void
*/
public function overwrite(array|string $message, int $newlines = 1, ?int $size = null): void {
Expand Down
5 changes: 5 additions & 0 deletions src/Controller/Admin/QueueController.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ public function index() {

/**
* @throws \Cake\Http\Exception\NotFoundException
*
* @return \Cake\Http\Response|null
*/
public function addJob() {
Expand Down Expand Up @@ -98,7 +99,9 @@ public function addJob() {

/**
* @param int|null $id
*
* @throws \Cake\Http\Exception\NotFoundException
*
* @return \Cake\Http\Response|null
*/
public function resetJob(?int $id = null) {
Expand All @@ -116,6 +119,7 @@ public function resetJob(?int $id = null) {

/**
* @param int|null $id
*
* @return \Cake\Http\Response|null
*/
public function removeJob(?int $id = null) {
Expand Down Expand Up @@ -202,6 +206,7 @@ public function hardReset() {

/**
* @param array<mixed>|string $default
*
* @return \Cake\Http\Response|null
*/
protected function refererRedirect(array|string $default) {
Expand Down
Loading

0 comments on commit 1eb6b23

Please sign in to comment.