$row */ public static function text( array $row, string $column ): string { $value = $row[ $column ] ?? null; if ( null === $value ) { throw new UnexpectedValueException( esc_html( 'The database row has no value in ' . $column . '.' ) ); } return $value; } /** @param array $row */ public static function whole_number( array $row, string $column ): int { return (int) self::text( $row, $column ); } /** @param array $row */ public static function optional_number( array $row, string $column ): int|null { $value = $row[ $column ] ?? null; return null === $value ? null : (int) $value; } }