Skip to content

Commit

Permalink
refactor and lint
Browse files Browse the repository at this point in the history
  • Loading branch information
faissaloux committed Oct 21, 2024
1 parent 8ca0807 commit dfc5fb9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
2 changes: 0 additions & 2 deletions src/Expectation.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

namespace Faissaloux\PestInside;

use Faissaloux\PestInside\Investigator;

final class Expectation extends Inside
{
use Investigator;
Expand Down
15 changes: 6 additions & 9 deletions src/Investigator.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,30 +7,28 @@
trait Investigator
{
/**
* @param array<string> $array
*
* @param array<string> $array
* @return array<string>
*/
private function lowercasesIn(array $array): array
{
$notLowerCase = [];
$unwanted = [];

foreach ($array as $word) {
if ($word === '') {
continue;
}

if (! ctype_lower(preg_replace('/[^A-Za-z]/', '', $word))) {
array_push($notLowerCase, $word);
$unwanted[] = $word;
}
}

return $notLowerCase;
return $unwanted;
}

/**
* @param array<string> $array
*
* @param array<string> $array
* @return array<string>
*/
private function duplicatesIn(array $array): array
Expand All @@ -39,8 +37,7 @@ private function duplicatesIn(array $array): array
}

/**
* @param array<string> $array
*
* @param array<string> $array
* @return array<string>
*/
private function singleWordsIn(array $array): array
Expand Down

0 comments on commit dfc5fb9

Please sign in to comment.