view->warning( $message, $this->get_dismiss_action_url() ); } /** * {@inheritdoc} */ protected function is_screen_allowed(): bool { return true; } /** * {@inheritdoc} */ protected function should_display(): bool { if ( parent::should_display() ) { $checker = new EnvironmentChecker( $this->get_constraints() ); try { $checker->check(); // Passed constraints, so do not display. return false; } catch ( ConstraintFailedExceptionInterface | \RuntimeException $e ) { return true; } } return false; } /** * Returns list of constraints to check. * * @return AbstractVersionConstraint[] The list of constraints */ abstract protected function get_constraints(): array; }