-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Cache][Lock] PdoAdapter
/PdoStore
minor cleanup
#52667
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
can you please rebase? |
5fae508
to
f5baad5
Compare
@nicolas-grekas Done |
return match (true) { | ||
'pgsql' === $driver && '42P01' === $code, | ||
'sqlite' === $driver && str_contains($exception->getMessage(), 'no such table:'), | ||
'oci' === $driver && 942 === $code, | ||
'sqlsrv' === $driver && 208 === $code, | ||
'mysql' === $driver && 1146 === $code => true, | ||
default => false, | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return match (true) { | |
'pgsql' === $driver && '42P01' === $code, | |
'sqlite' === $driver && str_contains($exception->getMessage(), 'no such table:'), | |
'oci' === $driver && 942 === $code, | |
'sqlsrv' === $driver && 208 === $code, | |
'mysql' === $driver && 1146 === $code => true, | |
default => false, | |
}; | |
return match ($driver) { | |
'pgsql' => '42P01' === $code, | |
'sqlite' => str_contains($exception->getMessage(), 'no such table:'), | |
'oci' => 942 === $code, | |
'sqlsrv' => 208 === $code, | |
'mysql' => 1146 === $code, | |
default => false, | |
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, looks much better this way, done.
return match (true) { | ||
'pgsql' === $driver && '42P01' === $code, | ||
'sqlite' === $driver && str_contains($exception->getMessage(), 'no such table:'), | ||
'oci' === $driver && 942 === $code, | ||
'sqlsrv' === $driver && 208 === $code, | ||
'mysql' === $driver && 1146 === $code => true, | ||
default => false, | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return match ($driver) {
'pgsql' => '42P01' === $code,
'sqlite' => str_contains($exception->getMessage(), 'no such table:'),
'oci' => 942 === $code,
'sqlsrv' => 208 === $code,
'mysql' => 1146 === $code,
default => false,
};
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
f5baad5
to
45e17d5
Compare
Thank you @HypeMC. |
Follow up to #52459.
Basically some code cleanup such as using
match
instead ofswitch
+ a minor sync between thePdoAdapter
andPdoStore
.I've targeted 6.4 since this is just a minor code cleanup, but I can switch to 7.1 if needed.