Upgrade to 4.0.0

This commit is contained in:
Bastian Allgeier
2023-11-28 09:33:56 +01:00
parent f96b96af76
commit 3b0b6546ca
480 changed files with 21371 additions and 13327 deletions

View File

@@ -50,17 +50,6 @@ class Remote
public array $options = [];
/**
* Magic getter for request info data
*/
public function __call(string $method, array $arguments = [])
{
$method = str_replace('-', '_', Str::kebab($method));
return $this->info[$method] ?? null;
}
/**
* Constructor
*
* @throws \Exception when the curl request failed
*/
public function __construct(string $url, array $options = [])
@@ -76,8 +65,7 @@ class Remote
// update the defaults with App config if set;
// request the App instance lazily
$app = App::instance(null, true);
if ($app !== null) {
if ($app = App::instance(null, true)) {
$defaults = array_merge($defaults, $app->option('remote', []));
}
@@ -91,8 +79,19 @@ class Remote
$this->fetch();
}
public static function __callStatic(string $method, array $arguments = []): static
/**
* Magic getter for request info data
*/
public function __call(string $method, array $arguments = [])
{
$method = str_replace('-', '_', Str::kebab($method));
return $this->info[$method] ?? null;
}
public static function __callStatic(
string $method,
array $arguments = []
): static {
return new static(
url: $arguments[0],
options: array_merge(