Skip to content

Commit

Permalink
Fixed coding standards.
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexSkrypnyk committed Nov 28, 2024
1 parent 7b3d663 commit 859153a
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions src/Commands/ArtifactCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ class ArtifactCommand extends Command {
* Command name.
*/
public function __construct(
ArtifactGit $gitWrapper = NULL,
Filesystem $fsFileSystem = NULL,
?ArtifactGit $gitWrapper = NULL,
?Filesystem $fsFileSystem = NULL,
?string $name = NULL,
) {
parent::__construct($name);
Expand Down Expand Up @@ -813,7 +813,7 @@ protected function restoreLocalExclude(string $path): void {
* @throws \Exception
* If removal command finished with an error.
*/
protected function removeIgnoredFiles(string $location, string $gitignorePath = NULL): void {
protected function removeIgnoredFiles(string $location, ?string $gitignorePath = NULL): void {
$location = $this->getSourcePathGitRepository();
$gitignorePath = $gitignorePath ?: $location . DIRECTORY_SEPARATOR . '.gitignore';

Expand Down Expand Up @@ -912,7 +912,7 @@ protected function getTokenBranch(): string {
*
* @throws \Exception
*/
protected function getTokenTags(string $delimiter = NULL): string {
protected function getTokenTags(?string $delimiter = NULL): string {
$delimiter = $delimiter ?: '-';
// We just want to get all tags point to the HEAD.
$tags = $this
Expand Down
4 changes: 2 additions & 2 deletions src/Traits/FilesystemTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ trait FilesystemTrait {
*
* @throws \Exception
*/
protected function fsSetRootDir(string $path = NULL): void {
protected function fsSetRootDir(?string $path = NULL): void {
$path = empty($path) ? $this->fsGetRootDir() : $this->fsGetAbsolutePath($path);
$this->fsPathsExist($path);
$this->fsRootDir = $path;
Expand Down Expand Up @@ -129,7 +129,7 @@ protected function fsIsCommandAvailable(string $command): bool {
* @return string
* Absolute path for provided file.
*/
protected function fsGetAbsolutePath(string $file, string $root = NULL): string {
protected function fsGetAbsolutePath(string $file, ?string $root = NULL): string {
if ($this->fsFileSystem->isAbsolutePath($file)) {
return $this->realpath($file);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/Exception/ErrorException.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class ErrorException extends Exception {
/**
* {@inheritdoc}
*/
public function __construct(string $message, int $code, string $file, int $line, \Exception $previous = NULL) {
public function __construct(string $message, int $code, string $file, int $line, ?\Exception $previous = NULL) {
parent::__construct($message, $code, $previous);

$this->file = $file;
Expand Down
8 changes: 4 additions & 4 deletions tests/phpunit/Traits/CommandTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ protected function gitGetCommittedFiles(string $path): array {
* Optional path to the repository directory. If not provided, fixture
* directory is used.
*/
protected function gitCreateFixtureCommits(int $count, int $offset = 0, string $path = NULL): void {
protected function gitCreateFixtureCommits(int $count, int $offset = 0, ?string $path = NULL): void {
$path = $path ? $path : $this->src;
for ($i = $offset; $i < $count + $offset; $i++) {
$this->gitCreateFixtureCommit($i + 1, $path);
Expand All @@ -202,7 +202,7 @@ protected function gitCreateFixtureCommits(int $count, int $offset = 0, string $
* @return string
* Hash of created commit.
*/
protected function gitCreateFixtureCommit(int $index, string $path = NULL): string {
protected function gitCreateFixtureCommit(int $index, ?string $path = NULL): string {
$path = $path ? $path : $this->src;
$filename = 'f' . $index;
$this->gitCreateFixtureFile($path, $filename);
Expand Down Expand Up @@ -348,7 +348,7 @@ protected function gitAddTag(string $path, string $name, bool $annotate = FALSE)
*
* @todo Update arguments order and add assertion message.
*/
protected function gitAssertFilesExist(string $path, $files, string $branch = NULL): void {
protected function gitAssertFilesExist(string $path, $files, ?string $branch = NULL): void {
$files = is_array($files) ? $files : [$files];
if ($branch) {
$this->gitCheckout($path, $branch);
Expand All @@ -368,7 +368,7 @@ protected function gitAssertFilesExist(string $path, $files, string $branch = NU
* @param string|null $branch
* Optional branch. If set, will be checked out before assertion.
*/
protected function gitAssertFilesNotExist(string $path, $files, string $branch = NULL): void {
protected function gitAssertFilesNotExist(string $path, $files, ?string $branch = NULL): void {
$files = is_array($files) ? $files : [$files];
if ($branch) {
$this->gitCheckout($path, $branch);
Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/Traits/ReflectionTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ protected static function setProtectedValue($object, $property, mixed $value): v
* @return mixed
* Protected property value.
*/
protected static function getProtectedValue($object, $property) {
protected static function getProtectedValue($object, $property): mixed {
$class = new \ReflectionClass($object::class);
$property = $class->getProperty($property);
$property->setAccessible(TRUE);
Expand Down

0 comments on commit 859153a

Please sign in to comment.