Skip to content

Commit

Permalink
Merge pull request #629 from MarkVaughn/mark/php7
Browse files Browse the repository at this point in the history
Adds PHP7 type hinting where missing
  • Loading branch information
Landerstraeten authored May 16, 2019
2 parents 55492d7 + c9acae5 commit 20923ea
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 17 deletions.
7 changes: 2 additions & 5 deletions src/Collection/TaskResultCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,11 @@ public function isFailed(): bool
return false;
}

/**
* @return int|mixed
*/
public function getResultCode()
public function getResultCode(): int
{
$resultCode = static::NO_TASKS;
foreach ($this as $taskResult) {
$resultCode = max($resultCode, $taskResult->getResultCode());
$resultCode = (int) max($resultCode, $taskResult->getResultCode());
}

return $resultCode;
Expand Down
2 changes: 1 addition & 1 deletion src/Console/Command/ConfigureCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ protected function guessGitDir(): string
return rtrim($this->paths()->getRelativePath($topLevel), '/');
}

public function pathValidator($path): string
public function pathValidator(string $path): string
{
if (!$this->filesystem->exists($path)) {
throw new RuntimeException(sprintf('The path %s could not be found!', $path));
Expand Down
3 changes: 0 additions & 3 deletions src/Console/Command/Git/PreCommitCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,6 @@ protected function configure()
);
}

/**
* @return int|void
*/
public function execute(InputInterface $input, OutputInterface $output)
{
$io = new ConsoleIO($input, $output);
Expand Down
3 changes: 0 additions & 3 deletions src/Console/Command/RunCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,6 @@ protected function configure()
);
}

/**
* @return int|void
*/
public function execute(InputInterface $input, OutputInterface $output)
{
$files = $this->getRegisteredFiles();
Expand Down
6 changes: 1 addition & 5 deletions src/Util/Str.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,8 @@ class Str
{
/**
* String contains one of the provided needles
*
* @param string $haystack
* @param array $needles
* @return bool
*/
public static function containsOneOf($haystack, array $needles)
public static function containsOneOf(string $haystack, array $needles): bool
{
foreach ($needles as $needle) {
if ($needle !== '' && mb_strpos($haystack, $needle) !== false) {
Expand Down

0 comments on commit 20923ea

Please sign in to comment.