Skip to content

Commit

Permalink
Fixed coding standards violations.
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexSkrypnyk committed Feb 2, 2024
1 parent be7c6b1 commit 26d7cb4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
10 changes: 6 additions & 4 deletions src/ArtefactTrait.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace DrevOps\Robo;

Expand Down Expand Up @@ -378,7 +378,7 @@ protected function dumpReport(): void
*
* @param string $mode
* Mode to set.
* @param array $options
* @param array $options
* Array of CLI options.
*
* @phpstan-ignore-next-line
Expand Down Expand Up @@ -617,7 +617,9 @@ protected function localExcludeEmpty(string $path, bool $strict = false): bool
$lines = file($filename);
if ($lines) {
$lines = array_map('trim', $lines);
$lines = array_filter($lines, 'strlen');
$lines = array_filter($lines, function ($line) {
return strlen($line) > 0;
});
$lines = array_filter($lines, function ($line) {
return strpos(trim($line), '#') !== 0;
});
Expand Down Expand Up @@ -667,7 +669,7 @@ protected function restoreLocalExclude(string $path): void
*
* @throws \Exception
*/
protected function gitAddAll(string $location): void
protected function gitAddAll(string $location): void
{
$result = $this->gitCommandRun(
$location,
Expand Down
7 changes: 5 additions & 2 deletions src/FilesystemTrait.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace DrevOps\Robo;

Expand Down Expand Up @@ -231,7 +231,10 @@ protected function realpath(string $path): string

// Resolve path parts (single dot, double dot and double delimiters).
$path = str_replace(['/', '\\'], DIRECTORY_SEPARATOR, $path);
$parts = array_filter(explode(DIRECTORY_SEPARATOR, $path), 'strlen');
$parts = array_filter(explode(DIRECTORY_SEPARATOR, $path), function ($part) {
return strlen($part) > 0;
});

$absolutes = [];
foreach ($parts as $part) {
if ('.' === $part) {
Expand Down

0 comments on commit 26d7cb4

Please sign in to comment.