/home/techb158/immovalet.com/vendor/moneyphp/money/src/Currencies
NameSizeModeActions
AggregateCurrencies.php16920644editdlrm
BitcoinCurrencies.php9370644editdlrm
CachedCurrencies.php23080644editdlrm
CurrencyList.php18490644editdlrm
ISOCurrencies.php23340644editdlrm
Edit: /home/techb158/immovalet.com/vendor/moneyphp/money/src/Currencies/CachedCurrencies.php (2308B)
*/ final class CachedCurrencies implements Currencies { /** * @var Currencies */ private $currencies; /** * @var CacheItemPoolInterface */ private $pool; /** * @param Currencies $currencies * @param CacheItemPoolInterface $pool */ public function __construct(Currencies $currencies, CacheItemPoolInterface $pool) { $this->currencies = $currencies; $this->pool = $pool; } /** * {@inheritdoc} */ public function contains(Currency $currency) { $item = $this->pool->getItem('currency|availability|'.$currency->getCode()); if (false === $item->isHit()) { $item->set($this->currencies->contains($currency)); if ($item instanceof TaggableItemInterface) { $item->addTag('currency.availability'); } $this->pool->save($item); } return $item->get(); } /** * {@inheritdoc} */ public function subunitFor(Currency $currency) { $item = $this->pool->getItem('currency|subunit|'.$currency->getCode()); if (false === $item->isHit()) { $item->set($this->currencies->subunitFor($currency)); if ($item instanceof TaggableItemInterface) { $item->addTag('currency.subunit'); } $this->pool->save($item); } return $item->get(); } /** * {@inheritdoc} */ public function getIterator() { return new \CallbackFilterIterator( $this->currencies->getIterator(), function (Currency $currency) { $item = $this->pool->getItem('currency|availability|'.$currency->getCode()); $item->set(true); if ($item instanceof TaggableItemInterface) { $item->addTag('currency.availability'); } $this->pool->save($item); return true; } ); } }