Checks the core version.
string $version: The core version, for example 10.2.
bool Whether the core version is higher than the requested one.
protected function coreVersion(string $version) : bool {
return version_compare(\Drupal::VERSION, $version, '>=');
}