Skip to content

Commit

Permalink
Add review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
apetushok committed Apr 25, 2024
1 parent 9dac057 commit 10770a0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/PackagePrivate/Parser/Parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,8 @@ private function buildQualification(): Qualification {

// TODO
private static function genQualificationValue( ?string $flag = null ): int {
if ( !is_string( $flag ) || !isset(self::$map[$flag]) ) {
throw new InvalidArgumentException( 'Qualifier is incorrect' );
if ( !is_string( $flag ) || !array_key_exists( $flag, self::$map ) ) {
throw new InvalidArgumentException( 'Qualifier is invalid' );
}

return (int)self::$map[$flag];
Expand Down
4 changes: 2 additions & 2 deletions tests/Unit/PackagePrivate/Parser/ParserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ public function setOpenMiddleNonExtDateValues(): array {
}

/**
* @dataProvider setCombinedUncertainAndApproximateQualifiers
* @dataProvider provideCombinedUncertainAndApproximateQualifiers
*/
public function testThrowExceptionWhenUsedCombinedUncertainAndApproximateQualifiers( string $combinedUncertainAndApproximate ): void {
$parser = new Parser();
Expand All @@ -303,7 +303,7 @@ public function testThrowExceptionWhenUsedCombinedUncertainAndApproximateQualifi
$parser->createEdtf( $combinedUncertainAndApproximate );
}

public function setCombinedUncertainAndApproximateQualifiers(): array {
public function provideCombinedUncertainAndApproximateQualifiers(): array {
return [
[ '1990?~' ],
[ '1990~?' ],
Expand Down

0 comments on commit 10770a0

Please sign in to comment.