CbrRateParser
in package
implements
FeedParser
FinalYes
Разбор XML Банка России: курс рубля за Nominal единиц валюты, запятая как разделитель.
Table of Contents
Interfaces
- FeedParser
- Разбор тела фида в таблицу курсов.
Properties
Methods
- __construct() : mixed
- parse() : ArrayRateProvider
- between() : array{text: string, offset: int}|null
- rate() : ExchangeRate
- units() : int
Properties
$catalog read-only
private
CurrencyCatalog
$catalog
$decimal read-only
private
DecimalRate
$decimal
$guard read-only
private
SourceGuard
$guard
$math read-only
private
IntegerMath
$math
Methods
__construct()
public
__construct(CurrencyCatalog $catalog, DecimalRate $decimal, IntegerMath $math, SourceGuard $guard) : mixed
Parameters
- $catalog : CurrencyCatalog
- $decimal : DecimalRate
- $math : IntegerMath
- $guard : SourceGuard
parse()
public
parse(string $payload) : ArrayRateProvider
Parameters
- $payload : string
Tags
Attributes
- #[Override]
Return values
ArrayRateProviderbetween()
private
between(string $payload, string $open, string $close, int $offset) : array{text: string, offset: int}|null
Parameters
- $payload : string
- $open : string
- $close : string
- $offset : int
Return values
array{text: string, offset: int}|nullrate()
private
rate(string $code, string $nominal, string $value, Currency $ruble) : ExchangeRate
Parameters
- $code : string
- $nominal : string
- $value : string
- $ruble : Currency
Tags
Return values
ExchangeRateunits()
private
units(string $nominal) : int
Parameters
- $nominal : string