Skip to content

Commit

Permalink
Merge pull request #61 from xsist10/refactor_require_primary_key
Browse files Browse the repository at this point in the history
Fixed order for entities that don't have a getVersion function.
  • Loading branch information
xsist10 authored Aug 27, 2022
2 parents c87eee8 + 0f4f3a1 commit 14f8c2a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/Engine/Check/Database/RequirePrimaryKey.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,17 @@ class RequirePrimaryKey implements Check
{
public function supports($entity): bool
{
if (!$entity instanceof Database) {
return false;
}
// If we can't determine the version we can't do this check
try {
$version = $entity->getVersion();
// We only want to examine MySQL versions >= 8.0.13 when the feature was added
return version_compare($version, '8.0.13', '>=');
} catch (UnknownVersion $e) {
return false;
}

// We only want to examine MySQL versions >= 8.0.13 when the feature was added
return $entity instanceof Database
&& version_compare($version, '8.0.13', '>=');
}

public function run($entity): ?Report
Expand Down

0 comments on commit 14f8c2a

Please sign in to comment.