frederikbosch
Repos
96
Followers
36
Following
1

Events

issue comment
PHP 8 compatibility

You can use the latest version 3. Very recently I made it compatible.

Created at 11 hours ago
issue comment
Ontbrekende adressen na het uitvoeren van adres.sh

Voor een volledig postcode CSV extract, adviseer ik adres-full te gebruiken. De stappen zijn als volgt, maar ik zal een en ander nog in PR aanbieden.

  1. switch naar de master voor de nieuwe gemeentelijke indelingen
  2. voer CREATE EXTENSION tablefunc uit in je PostgreSQL database
  3. installeer python3-openpyxl en python3-xlrd
  4. voer de onderstaande commando's uit (-h en --username zelf toevoegen aan de psql regels)
sh etl.sh -a bag_input_file=/tmp/lvbag-extract-nl.zip
psql bagv2 -f sql/adres/adres-tabel-plus.sql
psql bagv2 -f sql/adres/adres-plus2adres-full-tabel.sql
psql bagv2 -f sql/adres/adres-full2csv.sql
ls -alh /tmp/bagadres-full.csv
Created at 1 week ago
Naming conventions

@slunak Great question.

  1. Let's go for MoneyPHP\CryptoCurrencies.
  2. And then also for moneyphp/crypto-currencies.
Created at 1 week ago
closed issue
Is it possibly to specify a currency to more decimals?

For example I want to see CAD to 8 decimal places, and calculate at that precision too. Is this possible with moneyphp?

Created at 1 week ago
issue comment
Is it possibly to specify a currency to more decimals?

Question is answered.

Created at 1 week ago
create tag
frederikbosch create tag v3.3.3
Created at 1 week ago
closed issue
Deprecated getIterator compatible

Deprecated: Return type of Money\Currencies\ISOCurrencies::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice

Created at 1 week ago
issue comment
Deprecated getIterator compatible

Fixed by #712.

Created at 1 week ago
  • fix deprecation on getIterator (#712)
Created at 1 week ago
pull request closed
Fix deprecation on getIterator 3.x

Fix #713

Created at 1 week ago
issue comment
Add underlying provider name to the currency pair

Not dropping the final keyword, anywhere. You don't need to extend, you need a new class, e.g. ProvidedCurrencyPair as I called in the example.

Created at 1 week ago

Update CHANGELOG.md

Created at 1 week ago

Update CHANGELOG.md

Created at 1 week ago
create tag
frederikbosch create tag 2.10.0
Created at 1 week ago

changelog update

Created at 1 week ago

allow ignoring headers during dkim signing

Merge pull request #104 from genkgo/dkim_ignore_headers

allow ignoring headers during dkim signing

Created at 1 week ago
pull request closed
allow ignoring headers during dkim signing
Created at 1 week ago
closed issue
ISOCurrencies::getIterator needs return type to be specified

Getting this error in PHP 8.1.10: "Return type of Money\Currencies\ISOCurrencies::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice [in APP/vendor/moneyphp/money/src/Currencies/ISOCurrencies.php, line 62]"

So line 62 needs to read: public function getIterator(): \Traversable and the error goes awaay

Created at 1 week ago
issue comment
ISOCurrencies::getIterator needs return type to be specified

This is not an issue. There is no support for PHP 8.1 for Money v3. However, if you create a PR with the ReturnTypeWillChanged attribute added to the method, I will merge it and create a tag for you.

Created at 1 week ago
pull request opened
allow ignoring headers during dkim signing
Created at 1 week ago
create branch
frederikbosch create branch dkim_ignore_headers
Created at 1 week ago

upgrade phpunit, remove deprecation warnings

upgrade phpstan

substr can return false

fix php 8.1 return type

Merge pull request #103 from genkgo/upgrade_dev

upgrade phpunit and phpstan

Created at 1 week ago
pull request closed
upgrade phpunit and phpstan
Created at 1 week ago
pull request closed
Add underlying provider name to the currency pair

Hey MoneyPHP team.

I am doing some currency conversations using the swap implementation as the baseline, which internally uses the exchange framework behind the scenes using its chain functionality.

I have been asked to save the conversion rate and the provider that was used to fetch that conversion rate somewhere. Which brings up a question that i am trying to solve "How can i get the provider that was used to fetch the conversion rate?"

I believe i have managed to solve that issue for the different implementations that we have for our exchange functionality by also allowing the "CurrencyPair" to hold that information for us.

I hope this will make it in so i can get the context i need.

If changing method signatures is considered a breaking change i would be open for changing that around.

Created at 1 week ago
issue comment
Add underlying provider name to the currency pair

You should solve this on your own end. Create a new (value) object and your own exchange.

<?php
use Exchanger\Contract\ExchangeRateProvider;
use Exchanger\CurrencyPair as ExchangerCurrencyPair;
use Exchanger\Exception\Exception as ExchangerException;
use Exchanger\ExchangeRateQuery;
use Money\Currency;
use Money\CurrencyPair;
use Money\Exception\UnresolvableCurrencyPairException;
use Money\Exchange;

use function assert;
use function is_numeric;
use function sprintf;

final class ProvidedCurrencyPair 
{
    private CurrencyPair $pair;
    private string providerName;

    public function __construct(CurrencyPair $pair, string $providerName) 
    {
        $this->pair = $pair;
        $this->providerName = $providerName;
    }

    public function getPair(): CurrencyPair
    {
         return $this->pair;
    }

    public function getProviderName(): string
    {
         return $this->providerName;
    }
}

final class MyExchange implements Exchange 
{
    private ExchangeRateProvider $exchanger;

    public function __construct(ExchangeRateProvider $exchanger)
    {
        $this->exchanger = $exchanger;
    }

    public function quoteWithProviderName(Currency $baseCurrency, Currency $counterCurrency): CurrencyPair
    {
        try {
            $query = new ExchangeRateQuery(
                new ExchangerCurrencyPair($baseCurrency->getCode(), $counterCurrency->getCode())
            );
            $rate  = $this->exchanger->getExchangeRate($query);
        } catch (ExchangerException) {
            throw UnresolvableCurrencyPairException::createFromCurrencies($baseCurrency, $counterCurrency);
        }

        $rateValue = sprintf('%.14F', $rate->getValue());

        assert(is_numeric($rateValue));

        return new ProvidedCurrencyPair(
            new CurrencyPair($baseCurrency, $counterCurrency, $rateValue), 
            $rate->getProviderName()
        );
    }

    public function quote(Currency $baseCurrency, Currency $counterCurrency): CurrencyPair 
    {
        return $this->decoratedExchange->quoteWithProvider($baseCurrency, $counterCurrency)->getPair();
    }
}
                                
Created at 1 week ago

fix php 8.1 return type

Created at 1 week ago

substr can return false

Created at 1 week ago

upgrade phpstan

Created at 1 week ago