migration_status = $migration_status; } /** * {@inheritDoc} */ public function register_hooks() { if ( $this->migration_status->get_error( 'free' ) === false ) { return; } \add_action( 'admin_notices', [ $this, 'render_migration_error' ] ); } /** * Renders the migration error. * * @return void */ public function render_migration_error() { // phpcs:ignore WordPress.Security.EscapeOutput -- The Migration_Error_Presenter already escapes it's output. echo new Migration_Error_Presenter( $this->migration_status->get_error( 'free' ) ); } }