$data */ public function update( array $data ): bool { $merged = wp_parse_args( $data, $this->get() ); return update_option( self::OPTION_NAME, array( 'status' => in_array( $merged['status'], self::STATUSES, true ) ? $merged['status'] : 'new', 'last_step' => absint( $merged['last_step'] ), 'site_type' => in_array( $merged['site_type'], self::SITE_TYPES, true ) ? $merged['site_type'] : '', ) ); } /** * @return array{status: string, last_step: int, site_type: string} */ private static function defaults(): array { return array( 'status' => 'new', 'last_step' => 0, 'site_type' => '', ); } }