allow vendord
All checks were successful
Build, Push and Deploy / build-and-push (push) Successful in 3m3s
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 16s
Build, Push and Deploy / deploy-staging (push) Successful in 32s
Build, Push and Deploy / deploy-production (push) Has been skipped
Build, Push and Deploy / cleanup (push) Successful in 1s
All checks were successful
Build, Push and Deploy / build-and-push (push) Successful in 3m3s
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 16s
Build, Push and Deploy / deploy-staging (push) Successful in 32s
Build, Push and Deploy / deploy-production (push) Has been skipped
Build, Push and Deploy / cleanup (push) Successful in 1s
This commit is contained in:
2042
vendor/moneyphp/money/resources/binance.php
vendored
Normal file
2042
vendor/moneyphp/money/resources/binance.php
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1255
vendor/moneyphp/money/resources/currency.php
vendored
Normal file
1255
vendor/moneyphp/money/resources/currency.php
vendored
Normal file
File diff suppressed because it is too large
Load Diff
75
vendor/moneyphp/money/resources/generate-money-factory.php
vendored
Normal file
75
vendor/moneyphp/money/resources/generate-money-factory.php
vendored
Normal file
@@ -0,0 +1,75 @@
|
||||
<?php
|
||||
|
||||
require __DIR__.'/../vendor/autoload.php';
|
||||
|
||||
use Money\Currencies;
|
||||
use Money\Currency;
|
||||
|
||||
(static function (): void {
|
||||
$buffer = <<<'PHP'
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Money;
|
||||
|
||||
use InvalidArgumentException;
|
||||
|
||||
/**
|
||||
* This is a generated file. Do not edit it manually!
|
||||
*
|
||||
PHPDOC
|
||||
* @psalm-immutable
|
||||
*/
|
||||
trait MoneyFactory
|
||||
{
|
||||
/**
|
||||
* Convenience factory method for a Money object.
|
||||
*
|
||||
* <code>
|
||||
* $fiveDollar = Money::USD(500);
|
||||
* </code>
|
||||
*
|
||||
* @param non-empty-string $method
|
||||
* @param array{numeric-string|int} $arguments
|
||||
*
|
||||
* @throws InvalidArgumentException If amount is not integer(ish).
|
||||
*
|
||||
* @psalm-pure
|
||||
*/
|
||||
public static function __callStatic(string $method, array $arguments): Money
|
||||
{
|
||||
return new Money($arguments[0], new Currency($method));
|
||||
}
|
||||
}
|
||||
|
||||
PHP;
|
||||
|
||||
$methodBuffer = '';
|
||||
|
||||
$iterator = new Currencies\AggregateCurrencies([
|
||||
new Currencies\ISOCurrencies(),
|
||||
new Currencies\BitcoinCurrencies(),
|
||||
new Currencies\CryptoCurrencies(),
|
||||
]);
|
||||
|
||||
$currencies = array_unique([...$iterator]);
|
||||
usort($currencies, static fn (Currency $a, Currency $b): int => strcmp($a->getCode(), $b->getCode()));
|
||||
|
||||
/** @var Currency[] $currencies */
|
||||
foreach ($currencies as $currency) {
|
||||
$code = $currency->getCode();
|
||||
if (is_numeric($code[0])) {
|
||||
preg_match('/^([0-9]*)(.*?)$/', $code, $extracted);
|
||||
|
||||
$formatter = new \NumberFormatter('en', \NumberFormatter::SPELLOUT);
|
||||
$code = strtoupper(preg_replace('/\s+/', '', $formatter->format($extracted[1])) . $extracted[2]);
|
||||
}
|
||||
|
||||
$methodBuffer .= sprintf(" * @method static Money %s(numeric-string|int \$amount)\n", $code);
|
||||
}
|
||||
|
||||
$buffer = str_replace('PHPDOC', rtrim($methodBuffer), $buffer);
|
||||
|
||||
file_put_contents(__DIR__.'/../src/MoneyFactory.php', $buffer);
|
||||
})();
|
||||
93
vendor/moneyphp/money/resources/generate-teller-factory.php
vendored
Normal file
93
vendor/moneyphp/money/resources/generate-teller-factory.php
vendored
Normal file
@@ -0,0 +1,93 @@
|
||||
<?php
|
||||
|
||||
require __DIR__.'/../vendor/autoload.php';
|
||||
|
||||
use Money\Currencies;
|
||||
use Money\Currencies\ISOCurrencies;
|
||||
use Money\Currency;
|
||||
use Money\Formatter\DecimalMoneyFormatter;
|
||||
use Money\Money;
|
||||
use Money\Parser\DecimalMoneyParser;
|
||||
use Money\Teller;
|
||||
|
||||
(static function (): void {
|
||||
$buffer = <<<'PHP'
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Money;
|
||||
|
||||
use Money\Currencies\ISOCurrencies;
|
||||
use Money\Formatter\DecimalMoneyFormatter;
|
||||
use Money\Parser\DecimalMoneyParser;
|
||||
|
||||
use function array_shift;
|
||||
|
||||
/**
|
||||
* This is a generated file. Do not edit it manually!
|
||||
*
|
||||
PHPDOC
|
||||
* @psalm-immutable
|
||||
*/
|
||||
trait TellerFactory
|
||||
{
|
||||
/**
|
||||
* Convenience factory method for a Teller object.
|
||||
*
|
||||
* <code>
|
||||
* $teller = Teller::USD();
|
||||
* </code>
|
||||
*
|
||||
* @param non-empty-string $method
|
||||
* @param array{0?: Money::ROUND_*} $arguments
|
||||
*/
|
||||
public static function __callStatic(string $method, array $arguments): Teller
|
||||
{
|
||||
$currency = new Currency($method);
|
||||
$currencies = new ISOCurrencies();
|
||||
$parser = new DecimalMoneyParser($currencies);
|
||||
$formatter = new DecimalMoneyFormatter($currencies);
|
||||
$roundingMode = empty($arguments)
|
||||
? Money::ROUND_HALF_UP
|
||||
: (int) array_shift($arguments);
|
||||
|
||||
return new Teller(
|
||||
$currency,
|
||||
$parser,
|
||||
$formatter,
|
||||
$roundingMode
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
PHP;
|
||||
|
||||
$methodBuffer = '';
|
||||
|
||||
$iterator = new Currencies\AggregateCurrencies([
|
||||
new Currencies\ISOCurrencies(),
|
||||
new Currencies\BitcoinCurrencies(),
|
||||
new Currencies\CryptoCurrencies(),
|
||||
]);
|
||||
|
||||
$currencies = array_unique([...$iterator]);
|
||||
usort($currencies, static fn (Currency $a, Currency $b): int => strcmp($a->getCode(), $b->getCode()));
|
||||
|
||||
/** @var Currency[] $currencies */
|
||||
foreach ($currencies as $currency) {
|
||||
$code = $currency->getCode();
|
||||
if (is_numeric($code[0])) {
|
||||
preg_match('/^([0-9]*)(.*?)$/', $code, $extracted);
|
||||
|
||||
$formatter = new \NumberFormatter('en', \NumberFormatter::SPELLOUT);
|
||||
$code = strtoupper(preg_replace('/\s+/', '', $formatter->format($extracted[1])) . $extracted[2]);
|
||||
}
|
||||
|
||||
$methodBuffer .= sprintf(" * @method static Teller %s(int \$roundingMode = Money::ROUND_HALF_UP)\n", $code);
|
||||
}
|
||||
|
||||
$buffer = str_replace('PHPDOC', rtrim($methodBuffer), $buffer);
|
||||
|
||||
file_put_contents(__DIR__.'/../src/TellerFactory.php', $buffer);
|
||||
})();
|
||||
Reference in New Issue
Block a user