From b0c28747d55c87242214aa9c710b2967c037ec42 Mon Sep 17 00:00:00 2001 From: Binyamin Yawitz <316103+byawitz@users.noreply.github.com> Date: Mon, 3 Jun 2024 10:11:30 -0400 Subject: [PATCH 01/13] feat: Moving to DI container --- composer.json | 17 ++++++++-- src/CLI/CLI.php | 89 ++++++++++++++++++++++--------------------------- 2 files changed, 53 insertions(+), 53 deletions(-) diff --git a/composer.json b/composer.json index 12160ff..d80a297 100755 --- a/composer.json +++ b/composer.json @@ -4,7 +4,7 @@ "type": "library", "keywords": ["php","framework", "upf", "utopia", "cli", "command line"], "license": "MIT", - + "scripts": { "test": "vendor/bin/phpunit --configuration phpunit.xml < tests/input.txt", "check": "vendor/bin/phpstan analyse -c phpstan.neon", @@ -16,7 +16,8 @@ }, "require": { "php": ">=7.4", - "utopia-php/framework": "0.34.*" + "utopia-php/framework": "dev-feat-di-upgrade as 0.34.99", + "utopia-php/di": "dev-main" }, "require-dev": { "phpunit/phpunit": "^9.3", @@ -24,5 +25,15 @@ "phpstan/phpstan": "^1.10", "laravel/pint": "1.2.*" }, - "minimum-stability": "dev" + "minimum-stability": "dev", + "repositories": [ + { + "type": "vcs", + "url": "https://github.com/utopia-php/di" + }, + { + "type": "vcs", + "url": "https://github.com/utopia-php/servers" + } + ] } diff --git a/src/CLI/CLI.php b/src/CLI/CLI.php index 042d9e2..12ce20e 100644 --- a/src/CLI/CLI.php +++ b/src/CLI/CLI.php @@ -3,6 +3,8 @@ namespace Utopia\CLI; use Exception; +use Utopia\DI\Container; +use Utopia\DI\Dependency; use Utopia\Http\Hook; use Utopia\Http\Validator; @@ -18,14 +20,9 @@ class CLI protected string $command = ''; /** - * @var array + * @var Container */ - protected array $resources = []; - - /** - * @var array - */ - protected static array $resourcesCallbacks = []; + protected Container $container; /** * Args @@ -75,7 +72,7 @@ class CLI /** * CLI constructor. * - * @param array $args + * @param array $args * * @throws Exception */ @@ -85,7 +82,7 @@ public function __construct(array $args = []) throw new Exception('CLI tasks can only work from the command line'); } - $this->args = $this->parse((! empty($args) || ! isset($_SERVER['argv'])) ? $args : $_SERVER['argv']); + $this->args = $this->parse((!empty($args) || !isset($_SERVER['argv'])) ? $args : $_SERVER['argv']); @\cli_set_process_title($this->command); } @@ -140,7 +137,7 @@ public function error(): Hook * * Add a new command task * - * @param string $name + * @param string $name * @return Task */ public function task(string $name): Task @@ -155,35 +152,26 @@ public function task(string $name): Task /** * If a resource has been created return it, otherwise create it and then return it * - * @param string $name - * @param bool $fresh + * @param string $name * @return mixed * * @throws Exception */ - public function getResource(string $name, bool $fresh = false): mixed + public function getResource(string $name): mixed { - if (! \array_key_exists($name, $this->resources) || $fresh || self::$resourcesCallbacks[$name]['reset']) { - if (! \array_key_exists($name, self::$resourcesCallbacks)) { - throw new Exception('Failed to find resource: "'.$name.'"'); - } - - $this->resources[$name] = \call_user_func_array( - self::$resourcesCallbacks[$name]['callback'], - $this->getResources(self::$resourcesCallbacks[$name]['injections']) - ); + if (!$this->container->has($name)) { + throw new Exception('Failed to find resource: "' . $name . '"'); } - self::$resourcesCallbacks[$name]['reset'] = false; - - return $this->resources[$name]; + return $this->container->get($name); } /** * Get Resources By List * - * @param array $list + * @param array $list * @return array + * @throws Exception */ public function getResources(array $list): array { @@ -199,22 +187,20 @@ public function getResources(array $list): array /** * Set a new resource callback * - * @param string $name - * @param callable $callback - * @param array $injections + * @param Dependency $dependency * @return void * * @throws Exception */ - public static function setResource(string $name, callable $callback, array $injections = []): void + public function setResource(Dependency $dependency): void { - self::$resourcesCallbacks[$name] = ['callback' => $callback, 'injections' => $injections, 'reset' => true]; + $this->container->set($dependency); } /** * task-name --foo=test * - * @param array $args + * @param array $args * @return array * * @throws Exception @@ -270,15 +256,16 @@ public function parse(array $args): array */ public function match(): ?Task { - return isset($this->tasks[$this->command]) ? $this->tasks[$this->command] : null; + return $this->tasks[$this->command] ?? null; } /** * Get Params * Get runtime params for the provided Hook * - * @param Hook $hook + * @param Hook $hook * @return array + * @throws Exception */ protected function getParams(Hook $hook): array { @@ -289,15 +276,13 @@ protected function getParams(Hook $hook): array $this->validate($key, $param, $value); - $params[$param['order']] = $value; + $params[] = $value; } - foreach ($hook->getInjections() as $key => $injection) { - $params[$injection['order']] = $this->getResource($injection['name']); + foreach ($hook->getDependencies() as $dependency) { + $params[] = $this->getResource($dependency); } - ksort($params); - return $params; } @@ -305,6 +290,7 @@ protected function getParams(Hook $hook): array * Run * * @return $this + * @throws Exception */ public function run(): self { @@ -327,7 +313,10 @@ public function run(): self } } catch (Exception $e) { foreach ($this->errors as $hook) { - self::setResource('error', fn () => $e); + $error = new Dependency(); + $error->setName('error')->setCallback(fn() => $e); + + $this->setResource($error); \call_user_func_array($hook->getAction(), $this->getParams($hook)); } } @@ -360,9 +349,9 @@ public function getArgs(): array * * Creates an validator instance and validate given value with given rules. * - * @param string $key - * @param array $param - * @param mixed $value + * @param string $key + * @param array $param + * @param mixed $value * * @throws Exception */ @@ -377,22 +366,22 @@ protected function validate(string $key, array $param, $value): void } // is the validator object an instance of the Validator class - if (! $validator instanceof Validator) { + if (!$validator instanceof Validator) { throw new Exception('Validator object is not an instance of the Validator class', 500); } - if (! $validator->isValid($value)) { - throw new Exception('Invalid '.$key.': '.$validator->getDescription(), 400); + if (!$validator->isValid($value)) { + throw new Exception('Invalid ' . $key . ': ' . $validator->getDescription(), 400); } } else { - if (! $param['optional']) { - throw new Exception('Param "'.$key.'" is not optional.', 400); + if (!$param['optional']) { + throw new Exception('Param "' . $key . '" is not optional.', 400); } } } - public static function reset(): void + public function reset(): void { - self::$resourcesCallbacks = []; + $this->container = new Container(); } } From fa737d93d478d1089b980695c7ce12eeb48e7945 Mon Sep 17 00:00:00 2001 From: Binyamin Yawitz <316103+byawitz@users.noreply.github.com> Date: Mon, 3 Jun 2024 10:15:38 -0400 Subject: [PATCH 02/13] feat: Adding DI container to constructor --- src/CLI/CLI.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/CLI/CLI.php b/src/CLI/CLI.php index 12ce20e..bd8ffe1 100644 --- a/src/CLI/CLI.php +++ b/src/CLI/CLI.php @@ -72,12 +72,14 @@ class CLI /** * CLI constructor. * + * @param Container $container * @param array $args * * @throws Exception */ - public function __construct(array $args = []) + public function __construct(Container $container, array $args = []) { + $this->container = $container; if (\php_sapi_name() !== 'cli') { throw new Exception('CLI tasks can only work from the command line'); } From f05872b7846f99bd44d42f9f7cfc0e6f39d7fadc Mon Sep 17 00:00:00 2001 From: Binyamin Yawitz <316103+byawitz@users.noreply.github.com> Date: Mon, 3 Jun 2024 12:25:18 -0400 Subject: [PATCH 03/13] feat: Changing to run inside a coroutine --- composer.json | 3 ++- src/CLI/CLI.php | 56 +++++++++++++++++++++++++++++++------------------ 2 files changed, 38 insertions(+), 21 deletions(-) diff --git a/composer.json b/composer.json index d80a297..ad89472 100755 --- a/composer.json +++ b/composer.json @@ -23,7 +23,8 @@ "phpunit/phpunit": "^9.3", "squizlabs/php_codesniffer": "^3.6", "phpstan/phpstan": "^1.10", - "laravel/pint": "1.2.*" + "laravel/pint": "1.2.*", + "swoole/ide-helper": "4.8.8" }, "minimum-stability": "dev", "repositories": [ diff --git a/src/CLI/CLI.php b/src/CLI/CLI.php index bd8ffe1..a9cedff 100644 --- a/src/CLI/CLI.php +++ b/src/CLI/CLI.php @@ -3,6 +3,8 @@ namespace Utopia\CLI; use Exception; +use Swoole\Process\Pool; +use Swoole\Runtime; use Utopia\DI\Container; use Utopia\DI\Dependency; use Utopia\Http\Hook; @@ -10,6 +12,8 @@ class CLI { + protected Pool $pool; + /** * Command * @@ -77,9 +81,8 @@ class CLI * * @throws Exception */ - public function __construct(Container $container, array $args = []) + public function __construct(array $args = []) { - $this->container = $container; if (\php_sapi_name() !== 'cli') { throw new Exception('CLI tasks can only work from the command line'); } @@ -87,6 +90,8 @@ public function __construct(Container $container, array $args = []) $this->args = $this->parse((!empty($args) || !isset($_SERVER['argv'])) ? $args : $_SERVER['argv']); @\cli_set_process_title($this->command); + Runtime::enableCoroutine(); + $this->pool = new Pool(1); } /** @@ -296,32 +301,38 @@ protected function getParams(Hook $hook): array */ public function run(): self { + $this->pool->set(['enable_coroutine' => true]); + $this->pool->start(); + $command = $this->match(); - try { - if ($command) { - foreach ($this->init as $hook) { - \call_user_func_array($hook->getAction(), $this->getParams($hook)); + $this->pool->on('WorkerStart', function (Pool $pool, string $workerId) use ($command) { + try { + if ($command) { + foreach ($this->init as $hook) { + \call_user_func_array($hook->getAction(), $this->getParams($hook)); + } + + // Call the callback with the matched positions as params + \call_user_func_array($command->getAction(), $this->getParams($command)); + + foreach ($this->shutdown as $hook) { + \call_user_func_array($hook->getAction(), $this->getParams($hook)); + } + } else { + throw new Exception('No command found'); } + } catch (Exception $e) { + foreach ($this->errors as $hook) { + $error = new Dependency(); + $error->setName('error')->setCallback(fn() => $e); - // Call the callback with the matched positions as params - \call_user_func_array($command->getAction(), $this->getParams($command)); - - foreach ($this->shutdown as $hook) { + $this->setResource($error); \call_user_func_array($hook->getAction(), $this->getParams($hook)); } - } else { - throw new Exception('No command found'); } - } catch (Exception $e) { - foreach ($this->errors as $hook) { - $error = new Dependency(); - $error->setName('error')->setCallback(fn() => $e); + }); - $this->setResource($error); - \call_user_func_array($hook->getAction(), $this->getParams($hook)); - } - } return $this; } @@ -382,6 +393,11 @@ protected function validate(string $key, array $param, $value): void } } + public function setContainer($container): void + { + $this->container = $container; + } + public function reset(): void { $this->container = new Container(); From c9b049160aff2eecea7dd1ff041165ae15f41f76 Mon Sep 17 00:00:00 2001 From: Binyamin Yawitz <316103+byawitz@users.noreply.github.com> Date: Mon, 3 Jun 2024 13:55:34 -0400 Subject: [PATCH 04/13] feat: Adding adapters and refactors --- README.md | 3 +- src/CLI/Adapter.php | 48 ++++++++++++++++++++++++++ src/CLI/Adapters/Generic.php | 44 ++++++++++++++++++++++++ src/CLI/Adapters/Swoole.php | 66 ++++++++++++++++++++++++++++++++++++ src/CLI/CLI.php | 39 +++++++++++++-------- 5 files changed, 184 insertions(+), 16 deletions(-) create mode 100644 src/CLI/Adapter.php create mode 100644 src/CLI/Adapters/Generic.php create mode 100644 src/CLI/Adapters/Swoole.php diff --git a/README.md b/README.md index 795785e..18105fe 100644 --- a/README.md +++ b/README.md @@ -22,9 +22,10 @@ require_once './vendor/autoload.php'; use Utopia\CLI\CLI; use Utopia\CLI\Console; +use Utopia\CLI\Adapters\Generic; use Utopia\Http\Validator\Wildcard; -$cli = new CLI(); +$cli = new CLI(new Generic()); $cli ->task('command-name') diff --git a/src/CLI/Adapter.php b/src/CLI/Adapter.php new file mode 100644 index 0000000..9f74563 --- /dev/null +++ b/src/CLI/Adapter.php @@ -0,0 +1,48 @@ +workerNum = $workerNum; + } + + /** + * Starts the Server. + * @param $callback + * @return self + */ + abstract public function start($callback): self; + + /** + * Stops the Server. + * @return self + */ + abstract public function stop(): self; + + /** + * Is called when a Worker starts. + * @param callable $callback + * @return self + */ + abstract public function onWorkerStart(callable $callback): self; + + /** + * Is called when a Worker stops. + * @param callable $callback + * @return self + */ + abstract public function onWorkerStop(callable $callback): self; + + /** + * Is called when a job is processed. + * @param callable $callback + * @return self + */ + abstract public function onJob(callable $callback): self; + +} diff --git a/src/CLI/Adapters/Generic.php b/src/CLI/Adapters/Generic.php new file mode 100644 index 0000000..0000818 --- /dev/null +++ b/src/CLI/Adapters/Generic.php @@ -0,0 +1,44 @@ +pool = new Pool($workerNum); + } + + public function start($callback): self + { + Runtime::enableCoroutine(); + $this->pool->set(['enable_coroutine' => true]); + + $this->onWorkerStart($callback); + + $this->pool->start(); + return $this; + } + + public function stop(): self + { + $this->pool->shutdown(); + return $this; + } + + public function onWorkerStart($callback): self + { + $this->pool->on('WorkerStart', function (Pool $pool, string $workerId) use ($callback) { + call_user_func($callback, $workerId); + }); + + return $this; + } + + public function onWorkerStop(callable $callback): self + { + $this->pool->on('WorkerStart', function (Pool $pool, string $workerId) use ($callback) { + call_user_func($callback, $workerId); + }); + + return $this; + } + + public function onJob(callable $callback): self + { + call_user_func($callback); + + return $this; + } + + public function getNative(): Pool + { + return $this->pool; + } +} diff --git a/src/CLI/CLI.php b/src/CLI/CLI.php index a9cedff..3574f3e 100644 --- a/src/CLI/CLI.php +++ b/src/CLI/CLI.php @@ -3,8 +3,7 @@ namespace Utopia\CLI; use Exception; -use Swoole\Process\Pool; -use Swoole\Runtime; +use Utopia\CLI\Adapters\Generic; use Utopia\DI\Container; use Utopia\DI\Dependency; use Utopia\Http\Hook; @@ -12,7 +11,14 @@ class CLI { - protected Pool $pool; + /** + * Adapter + * + * Type of adapter to pass the callable to + * + * @var Adapter + */ + protected Adapter $adapter; /** * Command @@ -76,12 +82,12 @@ class CLI /** * CLI constructor. * - * @param Container $container + * @param Adapter $adapter * @param array $args * * @throws Exception */ - public function __construct(array $args = []) + public function __construct(Adapter $adapter, array $args = []) { if (\php_sapi_name() !== 'cli') { throw new Exception('CLI tasks can only work from the command line'); @@ -90,8 +96,9 @@ public function __construct(array $args = []) $this->args = $this->parse((!empty($args) || !isset($_SERVER['argv'])) ? $args : $_SERVER['argv']); @\cli_set_process_title($this->command); - Runtime::enableCoroutine(); - $this->pool = new Pool(1); + + $this->adapter = $adapter; + $this->container = new Container(); } /** @@ -283,10 +290,14 @@ protected function getParams(Hook $hook): array $this->validate($key, $param, $value); - $params[] = $value; + $params[$key] = $value; } foreach ($hook->getDependencies() as $dependency) { + if(array_key_exists($dependency, $params)){ + continue; + } + $params[] = $this->getResource($dependency); } @@ -301,12 +312,9 @@ protected function getParams(Hook $hook): array */ public function run(): self { - $this->pool->set(['enable_coroutine' => true]); - $this->pool->start(); - - $command = $this->match(); + $this->adapter->start(function () { + $command = $this->match(); - $this->pool->on('WorkerStart', function (Pool $pool, string $workerId) use ($command) { try { if ($command) { foreach ($this->init as $hook) { @@ -333,7 +341,6 @@ public function run(): self } }); - return $this; } @@ -393,9 +400,11 @@ protected function validate(string $key, array $param, $value): void } } - public function setContainer($container): void + public function setContainer($container): self { $this->container = $container; + + return $this; } public function reset(): void From caea27c18a7d701a63e985a7aad1bfa7827ab469 Mon Sep 17 00:00:00 2001 From: Binyamin Yawitz <316103+byawitz@users.noreply.github.com> Date: Wed, 5 Jun 2024 08:46:38 -0400 Subject: [PATCH 05/13] feat: Managing worker stop and refactoring --- src/CLI/Adapters/Swoole.php | 4 ++-- src/CLI/CLI.php | 5 ++++- src/CLI/Task.php | 2 -- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/CLI/Adapters/Swoole.php b/src/CLI/Adapters/Swoole.php index 3385688..a248aa4 100644 --- a/src/CLI/Adapters/Swoole.php +++ b/src/CLI/Adapters/Swoole.php @@ -23,7 +23,7 @@ public function start($callback): self $this->pool->set(['enable_coroutine' => true]); $this->onWorkerStart($callback); - + $this->onWorkerStop(fn() => $this->pool->shutdown()); $this->pool->start(); return $this; } @@ -45,7 +45,7 @@ public function onWorkerStart($callback): self public function onWorkerStop(callable $callback): self { - $this->pool->on('WorkerStart', function (Pool $pool, string $workerId) use ($callback) { + $this->pool->on('WorkerStop', function (Pool $pool, string $workerId) use ($callback) { call_user_func($callback, $workerId); }); diff --git a/src/CLI/CLI.php b/src/CLI/CLI.php index 3574f3e..a887520 100644 --- a/src/CLI/CLI.php +++ b/src/CLI/CLI.php @@ -290,7 +290,10 @@ protected function getParams(Hook $hook): array $this->validate($key, $param, $value); - $params[$key] = $value; + $key = str_replace('-','_',$key); + $camelCase = \lcfirst(\str_replace('_', '', \ucwords($key, '_'))); + + $params[$camelCase] = $value; } foreach ($hook->getDependencies() as $dependency) { diff --git a/src/CLI/Task.php b/src/CLI/Task.php index a28cd9f..d2fd073 100644 --- a/src/CLI/Task.php +++ b/src/CLI/Task.php @@ -19,8 +19,6 @@ class Task extends Hook public function __construct(string $name) { $this->name = $name; - $this->action = function (): void { - }; } /** From f77c5a1f874c817bd815b073579d1b26f9bd9832 Mon Sep 17 00:00:00 2001 From: Binyamin Yawitz <316103+byawitz@users.noreply.github.com> Date: Fri, 7 Jun 2024 14:41:52 -0400 Subject: [PATCH 06/13] chore: Updating DI branch --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index ad89472..0c4d176 100755 --- a/composer.json +++ b/composer.json @@ -17,7 +17,7 @@ "require": { "php": ">=7.4", "utopia-php/framework": "dev-feat-di-upgrade as 0.34.99", - "utopia-php/di": "dev-main" + "utopia-php/di": "dev-dev" }, "require-dev": { "phpunit/phpunit": "^9.3", From bedbca08f451dc96f0321014e805a1f46f76f6b9 Mon Sep 17 00:00:00 2001 From: Binyamin Yawitz <316103+byawitz@users.noreply.github.com> Date: Fri, 7 Jun 2024 14:51:16 -0400 Subject: [PATCH 07/13] chore: Updating DI branch --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 0c4d176..0239fcd 100755 --- a/composer.json +++ b/composer.json @@ -17,7 +17,7 @@ "require": { "php": ">=7.4", "utopia-php/framework": "dev-feat-di-upgrade as 0.34.99", - "utopia-php/di": "dev-dev" + "utopia-php/di": "dev-feat-framework-v2" }, "require-dev": { "phpunit/phpunit": "^9.3", From d48b696891dee1e46df2491d192bb91cf4df8f94 Mon Sep 17 00:00:00 2001 From: Binyamin Yawitz <316103+byawitz@users.noreply.github.com> Date: Mon, 24 Jun 2024 09:24:20 -0400 Subject: [PATCH 08/13] chore: Updating and tests --- src/CLI/Adapter.php | 12 ++++--- src/CLI/Adapters/Generic.php | 4 +-- src/CLI/Adapters/Swoole.php | 4 ++- src/CLI/CLI.php | 61 ++++++++++++++++++++---------------- tests/CLI/CLITest.php | 55 +++++++++++++++++++------------- tests/CLI/TaskTest.php | 8 ++--- 6 files changed, 83 insertions(+), 61 deletions(-) diff --git a/src/CLI/Adapter.php b/src/CLI/Adapter.php index 9f74563..3deac7d 100644 --- a/src/CLI/Adapter.php +++ b/src/CLI/Adapter.php @@ -13,6 +13,7 @@ public function __construct(int $workerNum = 0) /** * Starts the Server. + * * @param $callback * @return self */ @@ -20,29 +21,32 @@ abstract public function start($callback): self; /** * Stops the Server. + * * @return self */ abstract public function stop(): self; /** * Is called when a Worker starts. - * @param callable $callback + * + * @param callable $callback * @return self */ abstract public function onWorkerStart(callable $callback): self; /** * Is called when a Worker stops. - * @param callable $callback + * + * @param callable $callback * @return self */ abstract public function onWorkerStop(callable $callback): self; /** * Is called when a job is processed. - * @param callable $callback + * + * @param callable $callback * @return self */ abstract public function onJob(callable $callback): self; - } diff --git a/src/CLI/Adapters/Generic.php b/src/CLI/Adapters/Generic.php index 0000818..01884b7 100644 --- a/src/CLI/Adapters/Generic.php +++ b/src/CLI/Adapters/Generic.php @@ -2,13 +2,10 @@ namespace Utopia\CLI\Adapters; -use Swoole\Process\Pool; -use Swoole\Runtime; use Utopia\CLI\Adapter; class Generic extends Adapter { - public function __construct(int $workerNum = 0) { parent::__construct($workerNum); @@ -39,6 +36,7 @@ public function onWorkerStop(callable $callback): self public function onJob(callable $callback): self { call_user_func($callback); + return $this; } } diff --git a/src/CLI/Adapters/Swoole.php b/src/CLI/Adapters/Swoole.php index a248aa4..b127b5d 100644 --- a/src/CLI/Adapters/Swoole.php +++ b/src/CLI/Adapters/Swoole.php @@ -23,14 +23,16 @@ public function start($callback): self $this->pool->set(['enable_coroutine' => true]); $this->onWorkerStart($callback); - $this->onWorkerStop(fn() => $this->pool->shutdown()); + $this->onWorkerStop(fn () => $this->pool->shutdown()); $this->pool->start(); + return $this; } public function stop(): self { $this->pool->shutdown(); + return $this; } diff --git a/src/CLI/CLI.php b/src/CLI/CLI.php index a887520..3091599 100644 --- a/src/CLI/CLI.php +++ b/src/CLI/CLI.php @@ -3,7 +3,6 @@ namespace Utopia\CLI; use Exception; -use Utopia\CLI\Adapters\Generic; use Utopia\DI\Container; use Utopia\DI\Dependency; use Utopia\Http\Hook; @@ -82,8 +81,8 @@ class CLI /** * CLI constructor. * - * @param Adapter $adapter - * @param array $args + * @param Adapter $adapter + * @param array $args * * @throws Exception */ @@ -93,7 +92,7 @@ public function __construct(Adapter $adapter, array $args = []) throw new Exception('CLI tasks can only work from the command line'); } - $this->args = $this->parse((!empty($args) || !isset($_SERVER['argv'])) ? $args : $_SERVER['argv']); + $this->args = $this->parse((! empty($args) || ! isset($_SERVER['argv'])) ? $args : $_SERVER['argv']); @\cli_set_process_title($this->command); @@ -151,7 +150,7 @@ public function error(): Hook * * Add a new command task * - * @param string $name + * @param string $name * @return Task */ public function task(string $name): Task @@ -166,15 +165,15 @@ public function task(string $name): Task /** * If a resource has been created return it, otherwise create it and then return it * - * @param string $name + * @param string $name * @return mixed * * @throws Exception */ public function getResource(string $name): mixed { - if (!$this->container->has($name)) { - throw new Exception('Failed to find resource: "' . $name . '"'); + if (! $this->container->has($name)) { + throw new Exception('Failed to find resource: "'.$name.'"'); } return $this->container->get($name); @@ -183,8 +182,9 @@ public function getResource(string $name): mixed /** * Get Resources By List * - * @param array $list + * @param array $list * @return array + * * @throws Exception */ public function getResources(array $list): array @@ -201,7 +201,7 @@ public function getResources(array $list): array /** * Set a new resource callback * - * @param Dependency $dependency + * @param Dependency $dependency * @return void * * @throws Exception @@ -214,7 +214,7 @@ public function setResource(Dependency $dependency): void /** * task-name --foo=test * - * @param array $args + * @param array $args * @return array * * @throws Exception @@ -277,8 +277,9 @@ public function match(): ?Task * Get Params * Get runtime params for the provided Hook * - * @param Hook $hook + * @param Hook $hook * @return array + * * @throws Exception */ protected function getParams(Hook $hook): array @@ -290,18 +291,15 @@ protected function getParams(Hook $hook): array $this->validate($key, $param, $value); - $key = str_replace('-','_',$key); - $camelCase = \lcfirst(\str_replace('_', '', \ucwords($key, '_'))); - - $params[$camelCase] = $value; + $params[$this->camelCaseIt($key)] = $value; } foreach ($hook->getDependencies() as $dependency) { - if(array_key_exists($dependency, $params)){ + if (array_key_exists($this->camelCaseIt($dependency), $params)) { continue; } - $params[] = $this->getResource($dependency); + $params[$this->camelCaseIt($dependency)] = $this->getResource($dependency); } return $params; @@ -311,6 +309,7 @@ protected function getParams(Hook $hook): array * Run * * @return $this + * * @throws Exception */ public function run(): self @@ -336,7 +335,7 @@ public function run(): self } catch (Exception $e) { foreach ($this->errors as $hook) { $error = new Dependency(); - $error->setName('error')->setCallback(fn() => $e); + $error->setName('error')->setCallback(fn () => $e); $this->setResource($error); \call_user_func_array($hook->getAction(), $this->getParams($hook)); @@ -372,9 +371,9 @@ public function getArgs(): array * * Creates an validator instance and validate given value with given rules. * - * @param string $key - * @param array $param - * @param mixed $value + * @param string $key + * @param array $param + * @param mixed $value * * @throws Exception */ @@ -389,16 +388,16 @@ protected function validate(string $key, array $param, $value): void } // is the validator object an instance of the Validator class - if (!$validator instanceof Validator) { + if (! $validator instanceof Validator) { throw new Exception('Validator object is not an instance of the Validator class', 500); } - if (!$validator->isValid($value)) { - throw new Exception('Invalid ' . $key . ': ' . $validator->getDescription(), 400); + if (! $validator->isValid($value)) { + throw new Exception('Invalid '.$key.': '.$validator->getDescription(), 400); } } else { - if (!$param['optional']) { - throw new Exception('Param "' . $key . '" is not optional.', 400); + if (! $param['optional']) { + throw new Exception('Param "'.$key.'" is not optional.', 400); } } } @@ -414,4 +413,12 @@ public function reset(): void { $this->container = new Container(); } + + private function camelCaseIt($key): string + { + $key = str_replace('-', '_', $key); + $camelCase = \lcfirst(\str_replace('_', '', \ucwords($key, '_'))); + + return $camelCase; + } } diff --git a/tests/CLI/CLITest.php b/tests/CLI/CLITest.php index 78a1992..134bdb4 100755 --- a/tests/CLI/CLITest.php +++ b/tests/CLI/CLITest.php @@ -3,7 +3,9 @@ namespace Utopia\Tests; use PHPUnit\Framework\TestCase; +use Utopia\CLI\Adapters\Generic; use Utopia\CLI\CLI; +use Utopia\DI\Dependency; use Utopia\Http\Validator\ArrayList; use Utopia\Http\Validator\Text; @@ -19,16 +21,23 @@ public function tearDown(): void public function testResources() { - $cli = new CLI(['test.php', 'build']); - CLI::setResource('rand', function () { - return rand(); - }); - CLI::setResource('first', function ($second) { - return 'first-'.$second; - }, ['second']); - CLI::setResource('second', function () { - return 'second'; - }); + $cli = new CLI(new Generic(), ['test.php', 'build']); + + $rand = new Dependency(); + $rand->setName('rand')->setCallback(fn () => rand()); + + $first = new Dependency(); + $first->setName('first') + ->inject('second') + ->setCallback(fn ($second) => 'first-'.$second); + + $second = new Dependency(); + $second->setName('second')->setCallback(fn () => 'second'); + + $cli->setResource($rand); + $cli->setResource($first); + $cli->setResource($second); + $second = $cli->getResource('second'); $first = $cli->getResource('first'); $this->assertEquals('second', $second); @@ -46,7 +55,7 @@ public function testAppSuccess() { ob_start(); - $cli = new CLI(['test.php', 'build', '--email=me@example.com']); // Mock command request + $cli = new CLI(new Generic(), ['test.php', 'build', '--email=me@example.com']); // Mock command request $cli ->task('build') @@ -66,7 +75,7 @@ public function testAppFailure() { ob_start(); - $cli = new CLI(['test.php', 'build', '--email=me.example.com']); // Mock command request + $cli = new CLI(new Generic(), ['test.php', 'build', '--email=me.example.com']); // Mock command request $cli ->task('build') @@ -86,7 +95,7 @@ public function testAppArray() { ob_start(); - $cli = new CLI(['test.php', 'build', '--email=me@example.com', '--list=item1', '--list=item2']); // Mock command request + $cli = new CLI(new Generic(), ['test.php', 'build', '--email=me@example.com', '--list=item1', '--list=item2']); // Mock command request $cli ->task('build') @@ -105,7 +114,7 @@ public function testAppArray() public function testGetTasks() { - $cli = new CLI(['test.php', 'build', '--email=me@example.com', '--list=item1', '--list=item2']); // Mock command request + $cli = new CLI(new Generic(), ['test.php', 'build', '--email=me@example.com', '--list=item1', '--list=item2']); // Mock command request $cli ->task('build1') @@ -128,7 +137,7 @@ public function testGetTasks() public function testGetArgs() { - $cli = new CLI(['test.php', 'build', '--email=me@example.com', '--list=item1', '--list=item2']); // Mock command request + $cli = new CLI(new Generic(), ['test.php', 'build', '--email=me@example.com', '--list=item1', '--list=item2']); // Mock command request $cli ->task('build1') @@ -152,9 +161,7 @@ public function testGetArgs() public function testHook() { - CLI::reset(); - - $cli = new CLI(['test.php', 'build', '--email=me@example.com', '--list=item1', '--list=item2']); + $cli = new CLI(new Generic(), ['test.php', 'build', '--email=me@example.com', '--list=item1', '--list=item2']); $cli ->init() @@ -188,8 +195,12 @@ public function testInjection() { ob_start(); - $cli = new CLI(['test.php', 'build', '--email=me@example.com']); - CLI::setResource('test', fn () => 'test-value'); + $cli = new CLI(new Generic(), ['test.php', 'build', '--email=me@example.com']); + + $test = new Dependency(); + $test->setName('test')->setCallback(fn () => 'test-value'); + + $cli->setResource($test); $cli->task('build') ->inject('test') @@ -207,7 +218,7 @@ public function testInjection() public function testMatch() { - $cli = new CLI(['test.php', 'build2', '--email=me@example.com', '--list=item1', '--list=item2']); // Mock command request + $cli = new CLI(new Generic(), ['test.php', 'build2', '--email=me@example.com', '--list=item1', '--list=item2']); // Mock command request $cli ->task('build1') @@ -227,7 +238,7 @@ public function testMatch() $this->assertEquals('build2', $cli->match()->getName()); - $cli = new CLI(['test.php', 'buildx', '--email=me@example.com', '--list=item1', '--list=item2']); // Mock command request + $cli = new CLI(new Generic(), ['test.php', 'buildx', '--email=me@example.com', '--list=item1', '--list=item2']); // Mock command request $cli ->task('build1') diff --git a/tests/CLI/TaskTest.php b/tests/CLI/TaskTest.php index ff34454..af22317 100755 --- a/tests/CLI/TaskTest.php +++ b/tests/CLI/TaskTest.php @@ -61,7 +61,7 @@ public function testParam() public function testResources() { - $this->assertEquals([], $this->task->getInjections()); + $this->assertEquals([], $this->task->getDependencies()); $this->task ->inject('user') @@ -69,8 +69,8 @@ public function testResources() ->action(function () { }); - $this->assertCount(2, $this->task->getInjections()); - $this->assertEquals('user', $this->task->getInjections()['user']['name']); - $this->assertEquals('time', $this->task->getInjections()['time']['name']); + $this->assertCount(2, $this->task->getDependencies()); + $this->assertEquals('user', $this->task->getDependencies()[0]); + $this->assertEquals('time', $this->task->getDependencies()[1]); } } From 7edc16ddee49268857a7f3ab0ca134c6a8d25b3c Mon Sep 17 00:00:00 2001 From: Binyamin Yawitz <316103+byawitz@users.noreply.github.com> Date: Thu, 8 Aug 2024 10:51:43 -0400 Subject: [PATCH 09/13] chore: updating versions --- .gitignore | 1 - composer.json | 5 +- composer.lock | 2124 +++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 2126 insertions(+), 4 deletions(-) create mode 100644 composer.lock diff --git a/.gitignore b/.gitignore index 2e18838..7b88ccc 100755 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ -composer.lock /vendor/ /.idea/ .phpunit.result.cache diff --git a/composer.json b/composer.json index 0239fcd..55c9c31 100755 --- a/composer.json +++ b/composer.json @@ -4,7 +4,6 @@ "type": "library", "keywords": ["php","framework", "upf", "utopia", "cli", "command line"], "license": "MIT", - "scripts": { "test": "vendor/bin/phpunit --configuration phpunit.xml < tests/input.txt", "check": "vendor/bin/phpstan analyse -c phpstan.neon", @@ -16,8 +15,8 @@ }, "require": { "php": ">=7.4", - "utopia-php/framework": "dev-feat-di-upgrade as 0.34.99", - "utopia-php/di": "dev-feat-framework-v2" + "utopia-php/framework": "1.0.0-RC1", + "utopia-php/di": "0.1.*" }, "require-dev": { "phpunit/phpunit": "^9.3", diff --git a/composer.lock b/composer.lock new file mode 100644 index 0000000..94d47e0 --- /dev/null +++ b/composer.lock @@ -0,0 +1,2124 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "588df53cb76ff906b437afb502d28b0c", + "packages": [ + { + "name": "utopia-php/di", + "version": "0.1.0", + "source": { + "type": "git", + "url": "https://github.com/utopia-php/di.git", + "reference": "22490c95f7ac3898ed1c33f1b1b5dd577305ee31" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/utopia-php/di/zipball/22490c95f7ac3898ed1c33f1b1b5dd577305ee31", + "reference": "22490c95f7ac3898ed1c33f1b1b5dd577305ee31", + "shasum": "" + }, + "require": { + "php": ">=8.2" + }, + "require-dev": { + "laravel/pint": "^1.2", + "phpbench/phpbench": "^1.2", + "phpstan/phpstan": "^1.10", + "phpunit/phpunit": "^9.5.25", + "swoole/ide-helper": "4.8.3" + }, + "type": "library", + "autoload": { + "psr-4": { + "Utopia\\": "src/", + "Tests\\E2E\\": "tests/e2e" + } + }, + "scripts": { + "lint": [ + "vendor/bin/pint --test" + ], + "format": [ + "vendor/bin/pint" + ], + "check": [ + "vendor/bin/phpstan analyse -c phpstan.neon" + ], + "test": [ + "vendor/bin/phpunit --configuration phpunit.xml" + ] + }, + "license": [ + "MIT" + ], + "description": "A simple and lite library for managing dependency injections", + "keywords": [ + "framework", + "http", + "php", + "upf" + ], + "support": { + "source": "https://github.com/utopia-php/di/tree/0.1.0", + "issues": "https://github.com/utopia-php/di/issues" + }, + "time": "2024-08-08T14:35:19+00:00" + }, + { + "name": "utopia-php/framework", + "version": "1.0.0-RC1", + "source": { + "type": "git", + "url": "https://github.com/utopia-php/http.git", + "reference": "7613c13166b491bf211d69415bc06d5a1ad7dcb5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/utopia-php/http/zipball/7613c13166b491bf211d69415bc06d5a1ad7dcb5", + "reference": "7613c13166b491bf211d69415bc06d5a1ad7dcb5", + "shasum": "" + }, + "require": { + "ext-swoole": "*", + "php": ">=8.0" + }, + "require-dev": { + "laravel/pint": "^1.2", + "phpbench/phpbench": "^1.2", + "phpstan/phpstan": "^1.10", + "phpunit/phpunit": "^9.5.25", + "swoole/ide-helper": "4.8.3" + }, + "type": "library", + "autoload": { + "psr-4": { + "Utopia\\Http\\": "src/Http" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "A simple, light and advanced PHP HTTP framework", + "keywords": [ + "framework", + "http", + "php", + "upf" + ], + "support": { + "issues": "https://github.com/utopia-php/http/issues", + "source": "https://github.com/utopia-php/http/tree/1.0.0-RC1" + }, + "time": "2024-01-08T11:07:19+00:00" + } + ], + "packages-dev": [ + { + "name": "doctrine/instantiator", + "version": "2.0.x-dev", + "source": { + "type": "git", + "url": "https://github.com/doctrine/instantiator.git", + "reference": "0dfb69d79d0964b8a80bfa92c07f50e3e8d73542" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/0dfb69d79d0964b8a80bfa92c07f50e3e8d73542", + "reference": "0dfb69d79d0964b8a80bfa92c07f50e3e8d73542", + "shasum": "" + }, + "require": { + "php": "^8.1" + }, + "require-dev": { + "doctrine/coding-standard": "^12", + "ext-pdo": "*", + "ext-phar": "*", + "phpbench/phpbench": "^1.2", + "phpstan/phpstan": "^1.9.4", + "phpstan/phpstan-phpunit": "^1.3", + "phpunit/phpunit": "^10.5", + "vimeo/psalm": "^5.4" + }, + "default-branch": true, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "homepage": "https://ocramius.github.io/" + } + ], + "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", + "homepage": "https://www.doctrine-project.org/projects/instantiator.html", + "keywords": [ + "constructor", + "instantiate" + ], + "support": { + "issues": "https://github.com/doctrine/instantiator/issues", + "source": "https://github.com/doctrine/instantiator/tree/2.0.x" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator", + "type": "tidelift" + } + ], + "time": "2024-06-20T19:34:15+00:00" + }, + { + "name": "laravel/pint", + "version": "v1.2.1", + "source": { + "type": "git", + "url": "https://github.com/laravel/pint.git", + "reference": "e60e2112ee779ce60f253695b273d1646a17d6f1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/laravel/pint/zipball/e60e2112ee779ce60f253695b273d1646a17d6f1", + "reference": "e60e2112ee779ce60f253695b273d1646a17d6f1", + "shasum": "" + }, + "require": { + "ext-json": "*", + "ext-mbstring": "*", + "ext-tokenizer": "*", + "ext-xml": "*", + "php": "^8.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^3.11.0", + "illuminate/view": "^9.32.0", + "laravel-zero/framework": "^9.2.0", + "mockery/mockery": "^1.5.1", + "nunomaduro/larastan": "^2.2.0", + "nunomaduro/termwind": "^1.14.0", + "pestphp/pest": "^1.22.1" + }, + "bin": [ + "builds/pint" + ], + "type": "project", + "autoload": { + "psr-4": { + "App\\": "app/", + "Database\\Seeders\\": "database/seeders/", + "Database\\Factories\\": "database/factories/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nuno Maduro", + "email": "enunomaduro@gmail.com" + } + ], + "description": "An opinionated code formatter for PHP.", + "homepage": "https://laravel.com", + "keywords": [ + "format", + "formatter", + "lint", + "linter", + "php" + ], + "support": { + "issues": "https://github.com/laravel/pint/issues", + "source": "https://github.com/laravel/pint" + }, + "time": "2022-11-29T16:25:20+00:00" + }, + { + "name": "myclabs/deep-copy", + "version": "1.x-dev", + "source": { + "type": "git", + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c", + "reference": "3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "conflict": { + "doctrine/collections": "<1.6.8", + "doctrine/common": "<2.13.3 || >=3 <3.2.2" + }, + "require-dev": { + "doctrine/collections": "^1.6.8", + "doctrine/common": "^2.13.3 || ^3.2.2", + "phpspec/prophecy": "^1.10", + "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" + }, + "default-branch": true, + "type": "library", + "autoload": { + "files": [ + "src/DeepCopy/deep_copy.php" + ], + "psr-4": { + "DeepCopy\\": "src/DeepCopy/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Create deep copies (clones) of your objects", + "keywords": [ + "clone", + "copy", + "duplicate", + "object", + "object graph" + ], + "support": { + "issues": "https://github.com/myclabs/DeepCopy/issues", + "source": "https://github.com/myclabs/DeepCopy/tree/1.12.0" + }, + "funding": [ + { + "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", + "type": "tidelift" + } + ], + "time": "2024-06-12T14:39:25+00:00" + }, + { + "name": "nikic/php-parser", + "version": "v5.1.0", + "source": { + "type": "git", + "url": "https://github.com/nikic/PHP-Parser.git", + "reference": "683130c2ff8c2739f4822ff7ac5c873ec529abd1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/683130c2ff8c2739f4822ff7ac5c873ec529abd1", + "reference": "683130c2ff8c2739f4822ff7ac5c873ec529abd1", + "shasum": "" + }, + "require": { + "ext-ctype": "*", + "ext-json": "*", + "ext-tokenizer": "*", + "php": ">=7.4" + }, + "require-dev": { + "ircmaxell/php-yacc": "^0.0.7", + "phpunit/phpunit": "^9.0" + }, + "bin": [ + "bin/php-parse" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0-dev" + } + }, + "autoload": { + "psr-4": { + "PhpParser\\": "lib/PhpParser" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Nikita Popov" + } + ], + "description": "A PHP parser written in PHP", + "keywords": [ + "parser", + "php" + ], + "support": { + "issues": "https://github.com/nikic/PHP-Parser/issues", + "source": "https://github.com/nikic/PHP-Parser/tree/v5.1.0" + }, + "time": "2024-07-01T20:03:41+00:00" + }, + { + "name": "phar-io/manifest", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/phar-io/manifest.git", + "reference": "54750ef60c58e43759730615a392c31c80e23176" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/54750ef60c58e43759730615a392c31c80e23176", + "reference": "54750ef60c58e43759730615a392c31c80e23176", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-libxml": "*", + "ext-phar": "*", + "ext-xmlwriter": "*", + "phar-io/version": "^3.0.1", + "php": "^7.2 || ^8.0" + }, + "default-branch": true, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", + "support": { + "issues": "https://github.com/phar-io/manifest/issues", + "source": "https://github.com/phar-io/manifest/tree/2.0.4" + }, + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } + ], + "time": "2024-03-03T12:33:53+00:00" + }, + { + "name": "phar-io/version", + "version": "3.2.1", + "source": { + "type": "git", + "url": "https://github.com/phar-io/version.git", + "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/version/zipball/4f7fd7836c6f332bb2933569e566a0d6c4cbed74", + "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Library for handling version information and constraints", + "support": { + "issues": "https://github.com/phar-io/version/issues", + "source": "https://github.com/phar-io/version/tree/3.2.1" + }, + "time": "2022-02-21T01:04:05+00:00" + }, + { + "name": "phpstan/phpstan", + "version": "1.12.x-dev", + "source": { + "type": "git", + "url": "https://github.com/phpstan/phpstan.git", + "reference": "3232b2f67faebe6b7ea54d68fb62223914ce35da" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/3232b2f67faebe6b7ea54d68fb62223914ce35da", + "reference": "3232b2f67faebe6b7ea54d68fb62223914ce35da", + "shasum": "" + }, + "require": { + "php": "^7.2|^8.0" + }, + "conflict": { + "phpstan/phpstan-shim": "*" + }, + "default-branch": true, + "bin": [ + "phpstan", + "phpstan.phar" + ], + "type": "library", + "autoload": { + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "PHPStan - PHP Static Analysis Tool", + "keywords": [ + "dev", + "static analysis" + ], + "support": { + "docs": "https://phpstan.org/user-guide/getting-started", + "forum": "https://github.com/phpstan/phpstan/discussions", + "issues": "https://github.com/phpstan/phpstan/issues", + "security": "https://github.com/phpstan/phpstan/security/policy", + "source": "https://github.com/phpstan/phpstan-src" + }, + "funding": [ + { + "url": "https://github.com/ondrejmirtes", + "type": "github" + }, + { + "url": "https://github.com/phpstan", + "type": "github" + } + ], + "time": "2024-08-08T11:38:51+00:00" + }, + { + "name": "phpunit/php-code-coverage", + "version": "9.2.x-dev", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "328a747f499cca790acff5634a4e55b957f40634" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/328a747f499cca790acff5634a4e55b957f40634", + "reference": "328a747f499cca790acff5634a4e55b957f40634", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-libxml": "*", + "ext-xmlwriter": "*", + "nikic/php-parser": "^4.18 || ^5.0", + "php": ">=7.3", + "phpunit/php-file-iterator": "^3.0.3", + "phpunit/php-text-template": "^2.0.2", + "sebastian/code-unit-reverse-lookup": "^2.0.2", + "sebastian/complexity": "^2.0", + "sebastian/environment": "^5.1.2", + "sebastian/lines-of-code": "^1.0.3", + "sebastian/version": "^3.0.1", + "theseer/tokenizer": "^1.2.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.6" + }, + "suggest": { + "ext-pcov": "PHP extension that provides line coverage", + "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "9.2.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", + "homepage": "https://github.com/sebastianbergmann/php-code-coverage", + "keywords": [ + "coverage", + "testing", + "xunit" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", + "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-07-17T05:19:21+00:00" + }, + { + "name": "phpunit/php-file-iterator", + "version": "3.0.x-dev", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "38b24367e1b340aa78b96d7cab042942d917bb84" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/38b24367e1b340aa78b96d7cab042942d917bb84", + "reference": "38b24367e1b340aa78b96d7cab042942d917bb84", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "FilterIterator implementation that filters files based on a list of suffixes.", + "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", + "keywords": [ + "filesystem", + "iterator" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2022-02-11T16:23:04+00:00" + }, + { + "name": "phpunit/php-invoker", + "version": "3.1.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-invoker.git", + "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/5a10147d0aaf65b58940a0b72f71c9ac0423cc67", + "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "ext-pcntl": "*", + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-pcntl": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Invoke callables with a timeout", + "homepage": "https://github.com/sebastianbergmann/php-invoker/", + "keywords": [ + "process" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-invoker/issues", + "source": "https://github.com/sebastianbergmann/php-invoker/tree/3.1.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:58:55+00:00" + }, + { + "name": "phpunit/php-text-template", + "version": "2.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", + "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "keywords": [ + "template" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-text-template/issues", + "source": "https://github.com/sebastianbergmann/php-text-template/tree/2.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T05:33:50+00:00" + }, + { + "name": "phpunit/php-timer", + "version": "5.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", + "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-timer/issues", + "source": "https://github.com/sebastianbergmann/php-timer/tree/5.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:16:10+00:00" + }, + { + "name": "phpunit/phpunit", + "version": "9.6.x-dev", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "0a965f7fb23a19ece6afe7dc4ad0307c11b04d5b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/0a965f7fb23a19ece6afe7dc4ad0307c11b04d5b", + "reference": "0a965f7fb23a19ece6afe7dc4ad0307c11b04d5b", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.5.0 || ^2", + "ext-dom": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xml": "*", + "ext-xmlwriter": "*", + "myclabs/deep-copy": "^1.12.0", + "phar-io/manifest": "^2.0.4", + "phar-io/version": "^3.2.1", + "php": ">=7.3", + "phpunit/php-code-coverage": "^9.2.31", + "phpunit/php-file-iterator": "^3.0.6", + "phpunit/php-invoker": "^3.1.1", + "phpunit/php-text-template": "^2.0.4", + "phpunit/php-timer": "^5.0.3", + "sebastian/cli-parser": "^1.0.2", + "sebastian/code-unit": "^1.0.8", + "sebastian/comparator": "^4.0.8", + "sebastian/diff": "^4.0.6", + "sebastian/environment": "^5.1.5", + "sebastian/exporter": "^4.0.6", + "sebastian/global-state": "^5.0.7", + "sebastian/object-enumerator": "^4.0.4", + "sebastian/resource-operations": "^3.0.4", + "sebastian/type": "^3.2.1", + "sebastian/version": "^3.0.2" + }, + "suggest": { + "ext-soap": "To be able to generate mocks based on WSDL files", + "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "9.6-dev" + } + }, + "autoload": { + "files": [ + "src/Framework/Assert/Functions.php" + ], + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "The PHP Unit Testing framework.", + "homepage": "https://phpunit.de/", + "keywords": [ + "phpunit", + "testing", + "xunit" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/phpunit/issues", + "security": "https://github.com/sebastianbergmann/phpunit/security/policy", + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6" + }, + "funding": [ + { + "url": "https://phpunit.de/sponsors.html", + "type": "custom" + }, + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpunit/phpunit", + "type": "tidelift" + } + ], + "time": "2024-08-08T11:55:08+00:00" + }, + { + "name": "sebastian/cli-parser", + "version": "1.0.x-dev", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/cli-parser.git", + "reference": "2b56bea83a09de3ac06bb18b92f068e60cc6f50b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/2b56bea83a09de3ac06bb18b92f068e60cc6f50b", + "reference": "2b56bea83a09de3ac06bb18b92f068e60cc6f50b", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for parsing CLI options", + "homepage": "https://github.com/sebastianbergmann/cli-parser", + "support": { + "issues": "https://github.com/sebastianbergmann/cli-parser/issues", + "source": "https://github.com/sebastianbergmann/cli-parser/tree/1.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-03-02T06:27:43+00:00" + }, + { + "name": "sebastian/code-unit", + "version": "1.0.8", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit.git", + "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/1fc9f64c0927627ef78ba436c9b17d967e68e120", + "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Collection of value objects that represent the PHP code units", + "homepage": "https://github.com/sebastianbergmann/code-unit", + "support": { + "issues": "https://github.com/sebastianbergmann/code-unit/issues", + "source": "https://github.com/sebastianbergmann/code-unit/tree/1.0.8" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:08:54+00:00" + }, + { + "name": "sebastian/code-unit-reverse-lookup", + "version": "2.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", + "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", + "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Looks up which function or method a line of code belongs to", + "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", + "support": { + "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", + "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/2.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:30:19+00:00" + }, + { + "name": "sebastian/comparator", + "version": "4.0.x-dev", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "b247957a1c8dc81a671770f74b479c0a78a818f1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/b247957a1c8dc81a671770f74b479c0a78a818f1", + "reference": "b247957a1c8dc81a671770f74b479c0a78a818f1", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/diff": "^4.0", + "sebastian/exporter": "^4.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + } + ], + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "https://github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/comparator/issues", + "source": "https://github.com/sebastianbergmann/comparator/tree/4.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2022-09-14T12:46:14+00:00" + }, + { + "name": "sebastian/complexity", + "version": "2.0.x-dev", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/complexity.git", + "reference": "25f207c40d62b8b7aa32f5ab026c53561964053a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/25f207c40d62b8b7aa32f5ab026c53561964053a", + "reference": "25f207c40d62b8b7aa32f5ab026c53561964053a", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4.18 || ^5.0", + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for calculating the complexity of PHP code units", + "homepage": "https://github.com/sebastianbergmann/complexity", + "support": { + "issues": "https://github.com/sebastianbergmann/complexity/issues", + "source": "https://github.com/sebastianbergmann/complexity/tree/2.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-12-22T06:19:30+00:00" + }, + { + "name": "sebastian/diff", + "version": "4.0.x-dev", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "ba01945089c3a293b01ba9badc29ad55b106b0bc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/ba01945089c3a293b01ba9badc29ad55b106b0bc", + "reference": "ba01945089c3a293b01ba9badc29ad55b106b0bc", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3", + "symfony/process": "^4.2 || ^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + } + ], + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", + "keywords": [ + "diff", + "udiff", + "unidiff", + "unified diff" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/diff/issues", + "source": "https://github.com/sebastianbergmann/diff/tree/4.0.6" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-03-02T06:30:58+00:00" + }, + { + "name": "sebastian/environment", + "version": "5.1.x-dev", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", + "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-posix": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides functionality to handle HHVM/PHP environments", + "homepage": "http://www.github.com/sebastianbergmann/environment", + "keywords": [ + "Xdebug", + "environment", + "hhvm" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/environment/issues", + "source": "https://github.com/sebastianbergmann/environment/tree/5.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T06:03:51+00:00" + }, + { + "name": "sebastian/exporter", + "version": "4.0.x-dev", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "78c00df8f170e02473b682df15bfcdacc3d32d72" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/78c00df8f170e02473b682df15bfcdacc3d32d72", + "reference": "78c00df8f170e02473b682df15bfcdacc3d32d72", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/recursion-context": "^4.0" + }, + "require-dev": { + "ext-mbstring": "*", + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Provides the functionality to export PHP variables for visualization", + "homepage": "https://www.github.com/sebastianbergmann/exporter", + "keywords": [ + "export", + "exporter" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/exporter/issues", + "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.6" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-03-02T06:33:00+00:00" + }, + { + "name": "sebastian/global-state", + "version": "5.0.x-dev", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9", + "reference": "bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/object-reflector": "^2.0", + "sebastian/recursion-context": "^4.0" + }, + "require-dev": { + "ext-dom": "*", + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-uopz": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Snapshotting of global state", + "homepage": "http://www.github.com/sebastianbergmann/global-state", + "keywords": [ + "global state" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/global-state/issues", + "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.7" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-03-02T06:35:11+00:00" + }, + { + "name": "sebastian/lines-of-code", + "version": "1.0.x-dev", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/lines-of-code.git", + "reference": "e1e4a170560925c26d424b6a03aed157e7dcc5c5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/e1e4a170560925c26d424b6a03aed157e7dcc5c5", + "reference": "e1e4a170560925c26d424b6a03aed157e7dcc5c5", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4.18 || ^5.0", + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for counting the lines of code in PHP source code", + "homepage": "https://github.com/sebastianbergmann/lines-of-code", + "support": { + "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", + "source": "https://github.com/sebastianbergmann/lines-of-code/tree/1.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-12-22T06:20:34+00:00" + }, + { + "name": "sebastian/object-enumerator", + "version": "4.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-enumerator.git", + "reference": "5c9eeac41b290a3712d88851518825ad78f45c71" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/5c9eeac41b290a3712d88851518825ad78f45c71", + "reference": "5c9eeac41b290a3712d88851518825ad78f45c71", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/object-reflector": "^2.0", + "sebastian/recursion-context": "^4.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Traverses array structures and object graphs to enumerate all referenced objects", + "homepage": "https://github.com/sebastianbergmann/object-enumerator/", + "support": { + "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", + "source": "https://github.com/sebastianbergmann/object-enumerator/tree/4.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:12:34+00:00" + }, + { + "name": "sebastian/object-reflector", + "version": "2.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-reflector.git", + "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", + "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Allows reflection of object attributes, including inherited and non-public ones", + "homepage": "https://github.com/sebastianbergmann/object-reflector/", + "support": { + "issues": "https://github.com/sebastianbergmann/object-reflector/issues", + "source": "https://github.com/sebastianbergmann/object-reflector/tree/2.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:14:26+00:00" + }, + { + "name": "sebastian/recursion-context", + "version": "4.0.x-dev", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", + "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides functionality to recursively process PHP variables", + "homepage": "https://github.com/sebastianbergmann/recursion-context", + "support": { + "issues": "https://github.com/sebastianbergmann/recursion-context/issues", + "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.5" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T06:07:39+00:00" + }, + { + "name": "sebastian/resource-operations", + "version": "dev-main", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/resource-operations.git", + "reference": "ff553e7482dcee39fa4acc2b175d6ddeb0f7bc25" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/ff553e7482dcee39fa4acc2b175d6ddeb0f7bc25", + "reference": "ff553e7482dcee39fa4acc2b175d6ddeb0f7bc25", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.0" + }, + "default-branch": true, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides a list of PHP built-in functions that operate on resources", + "homepage": "https://www.github.com/sebastianbergmann/resource-operations", + "support": { + "source": "https://github.com/sebastianbergmann/resource-operations/tree/main" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-03-14T18:47:08+00:00" + }, + { + "name": "sebastian/type", + "version": "3.2.x-dev", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/type.git", + "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", + "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.2-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Collection of value objects that represent the types of the PHP type system", + "homepage": "https://github.com/sebastianbergmann/type", + "support": { + "issues": "https://github.com/sebastianbergmann/type/issues", + "source": "https://github.com/sebastianbergmann/type/tree/3.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T06:13:03+00:00" + }, + { + "name": "sebastian/version", + "version": "3.0.x-dev", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "c6c1022351a901512170118436c764e473f6de8c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c6c1022351a901512170118436c764e473f6de8c", + "reference": "c6c1022351a901512170118436c764e473f6de8c", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that helps with managing the version number of Git-hosted PHP projects", + "homepage": "https://github.com/sebastianbergmann/version", + "support": { + "issues": "https://github.com/sebastianbergmann/version/issues", + "source": "https://github.com/sebastianbergmann/version/tree/3.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T06:39:44+00:00" + }, + { + "name": "squizlabs/php_codesniffer", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", + "reference": "638cfb69ad6819e3d2e479c9523b879f771b2ef7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/638cfb69ad6819e3d2e479c9523b879f771b2ef7", + "reference": "638cfb69ad6819e3d2e479c9523b879f771b2ef7", + "shasum": "" + }, + "require": { + "ext-simplexml": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": ">=5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.3.4" + }, + "default-branch": true, + "bin": [ + "bin/phpcbf", + "bin/phpcs" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Greg Sherwood", + "role": "Former lead" + }, + { + "name": "Juliette Reinders Folmer", + "role": "Current lead" + }, + { + "name": "Contributors", + "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer/graphs/contributors" + } + ], + "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", + "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer", + "keywords": [ + "phpcs", + "standards", + "static analysis" + ], + "support": { + "issues": "https://github.com/PHPCSStandards/PHP_CodeSniffer/issues", + "security": "https://github.com/PHPCSStandards/PHP_CodeSniffer/security/policy", + "source": "https://github.com/PHPCSStandards/PHP_CodeSniffer", + "wiki": "https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki" + }, + "funding": [ + { + "url": "https://github.com/PHPCSStandards", + "type": "github" + }, + { + "url": "https://github.com/jrfnl", + "type": "github" + }, + { + "url": "https://opencollective.com/php_codesniffer", + "type": "open_collective" + } + ], + "time": "2024-08-05T00:27:27+00:00" + }, + { + "name": "swoole/ide-helper", + "version": "4.8.8", + "source": { + "type": "git", + "url": "https://github.com/swoole/ide-helper.git", + "reference": "dd87843a5040831f9ad40b68fb57879b7342ef61" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/swoole/ide-helper/zipball/dd87843a5040831f9ad40b68fb57879b7342ef61", + "reference": "dd87843a5040831f9ad40b68fb57879b7342ef61", + "shasum": "" + }, + "type": "library", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Team Swoole", + "email": "team@swoole.com" + } + ], + "description": "IDE help files for Swoole.", + "support": { + "issues": "https://github.com/swoole/ide-helper/issues", + "source": "https://github.com/swoole/ide-helper/tree/4.8.8" + }, + "funding": [ + { + "url": "https://gitee.com/swoole/swoole?donate=true", + "type": "custom" + }, + { + "url": "https://github.com/swoole", + "type": "github" + } + ], + "time": "2022-03-17T18:24:39+00:00" + }, + { + "name": "theseer/tokenizer", + "version": "1.2.3", + "source": { + "type": "git", + "url": "https://github.com/theseer/tokenizer.git", + "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2", + "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": "^7.2 || ^8.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + } + ], + "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", + "support": { + "issues": "https://github.com/theseer/tokenizer/issues", + "source": "https://github.com/theseer/tokenizer/tree/1.2.3" + }, + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } + ], + "time": "2024-03-03T12:36:25+00:00" + } + ], + "aliases": [], + "minimum-stability": "dev", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": { + "php": ">=7.4" + }, + "platform-dev": [], + "plugin-api-version": "2.6.0" +} From a2271fda8d11f04b9fc8f8b5bc9221478ea53463 Mon Sep 17 00:00:00 2001 From: Binyamin Yawitz <316103+byawitz@users.noreply.github.com> Date: Thu, 8 Aug 2024 11:11:13 -0400 Subject: [PATCH 10/13] refactor: Making CLI non-breaking --- composer.json | 2 +- src/CLI/CLI.php | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index 55c9c31..e1b5724 100755 --- a/composer.json +++ b/composer.json @@ -15,7 +15,7 @@ }, "require": { "php": ">=7.4", - "utopia-php/framework": "1.0.0-RC1", + "utopia-php/framework": "1.0.*", "utopia-php/di": "0.1.*" }, "require-dev": { diff --git a/src/CLI/CLI.php b/src/CLI/CLI.php index 3091599..c76a852 100644 --- a/src/CLI/CLI.php +++ b/src/CLI/CLI.php @@ -3,6 +3,7 @@ namespace Utopia\CLI; use Exception; +use Utopia\CLI\Adapters\Generic; use Utopia\DI\Container; use Utopia\DI\Dependency; use Utopia\Http\Hook; @@ -81,12 +82,12 @@ class CLI /** * CLI constructor. * - * @param Adapter $adapter + * @param Adapter|null $adapter * @param array $args * * @throws Exception */ - public function __construct(Adapter $adapter, array $args = []) + public function __construct(Adapter $adapter = null, array $args = []) { if (\php_sapi_name() !== 'cli') { throw new Exception('CLI tasks can only work from the command line'); @@ -96,7 +97,7 @@ public function __construct(Adapter $adapter, array $args = []) @\cli_set_process_title($this->command); - $this->adapter = $adapter; + $this->adapter = $adapter ?? new Generic(); $this->container = new Container(); } From f928610c4d60ce2b8842e42fbb96a26ead0e9b4f Mon Sep 17 00:00:00 2001 From: Binyamin Yawitz <316103+byawitz@users.noreply.github.com> Date: Thu, 8 Aug 2024 11:12:35 -0400 Subject: [PATCH 11/13] chore: updating versions --- composer.lock | 91 ++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 82 insertions(+), 9 deletions(-) diff --git a/composer.lock b/composer.lock index 94d47e0..93800a5 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "588df53cb76ff906b437afb502d28b0c", + "content-hash": "20dd81616c1026183ef52176c78edc6f", "packages": [ { "name": "utopia-php/di", @@ -69,23 +69,25 @@ }, { "name": "utopia-php/framework", - "version": "1.0.0-RC1", + "version": "1.0.0-RC2", "source": { "type": "git", "url": "https://github.com/utopia-php/http.git", - "reference": "7613c13166b491bf211d69415bc06d5a1ad7dcb5" + "reference": "d1e9674dbf33bed03fa53854ec1f2c6e074cf4d7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/http/zipball/7613c13166b491bf211d69415bc06d5a1ad7dcb5", - "reference": "7613c13166b491bf211d69415bc06d5a1ad7dcb5", + "url": "https://api.github.com/repos/utopia-php/http/zipball/d1e9674dbf33bed03fa53854ec1f2c6e074cf4d7", + "reference": "d1e9674dbf33bed03fa53854ec1f2c6e074cf4d7", "shasum": "" }, "require": { "ext-swoole": "*", - "php": ">=8.0" + "php": ">=8.0", + "utopia-php/servers": "0.1.* " }, "require-dev": { + "ext-xdebug": "*", "laravel/pint": "^1.2", "phpbench/phpbench": "^1.2", "phpstan/phpstan": "^1.10", @@ -95,7 +97,7 @@ "type": "library", "autoload": { "psr-4": { - "Utopia\\Http\\": "src/Http" + "Utopia\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -111,9 +113,80 @@ ], "support": { "issues": "https://github.com/utopia-php/http/issues", - "source": "https://github.com/utopia-php/http/tree/1.0.0-RC1" + "source": "https://github.com/utopia-php/http/tree/1.0.0-RC2" }, - "time": "2024-01-08T11:07:19+00:00" + "time": "2024-08-08T14:46:41+00:00" + }, + { + "name": "utopia-php/servers", + "version": "0.1.0", + "source": { + "type": "git", + "url": "https://github.com/utopia-php/servers.git", + "reference": "7d9e4f364fb1ab1889fb89ca96eb9946467cb09c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/utopia-php/servers/zipball/7d9e4f364fb1ab1889fb89ca96eb9946467cb09c", + "reference": "7d9e4f364fb1ab1889fb89ca96eb9946467cb09c", + "shasum": "" + }, + "require": { + "php": ">=8.0", + "utopia-php/di": "0.1.*" + }, + "require-dev": { + "laravel/pint": "^0.2.3", + "phpstan/phpstan": "^1.8", + "phpunit/phpunit": "^9.5.5" + }, + "type": "library", + "autoload": { + "psr-4": { + "Utopia\\Servers\\": "src/Servers" + } + }, + "autoload-dev": { + "psr-4": { + "Tests\\E2E\\": "tests/Servers/Unit" + } + }, + "scripts": { + "test": [ + "phpunit" + ], + "analyse": [ + "vendor/bin/phpstan analyse" + ], + "format": [ + "vendor/bin/pint" + ], + "lint": [ + "vendor/bin/pint --test" + ] + }, + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Team Appwrite", + "email": "team@appwrite.io" + } + ], + "description": "A base library for building Utopia style servers.", + "keywords": [ + "framework", + "php", + "servers", + "upf", + "utopia" + ], + "support": { + "source": "https://github.com/utopia-php/servers/tree/0.1.0", + "issues": "https://github.com/utopia-php/servers/issues" + }, + "time": "2024-08-08T14:31:39+00:00" } ], "packages-dev": [ From 7664161dcdb9b76a3ece0ae2f36a9aca1e548e80 Mon Sep 17 00:00:00 2001 From: Binyamin Yawitz <316103+byawitz@users.noreply.github.com> Date: Fri, 9 Aug 2024 13:35:04 -0400 Subject: [PATCH 12/13] chore: updating versions --- composer.json | 14 +++--------- composer.lock | 61 +++++++++++++-------------------------------------- 2 files changed, 18 insertions(+), 57 deletions(-) diff --git a/composer.json b/composer.json index e1b5724..4101d56 100755 --- a/composer.json +++ b/composer.json @@ -25,15 +25,7 @@ "laravel/pint": "1.2.*", "swoole/ide-helper": "4.8.8" }, - "minimum-stability": "dev", - "repositories": [ - { - "type": "vcs", - "url": "https://github.com/utopia-php/di" - }, - { - "type": "vcs", - "url": "https://github.com/utopia-php/servers" - } - ] + "minimum-stability": "dev" + + } diff --git a/composer.lock b/composer.lock index 93800a5..411104b 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "20dd81616c1026183ef52176c78edc6f", + "content-hash": "d1a7cb9ca663d0c8a80218a3ff5c2d0c", "packages": [ { "name": "utopia-php/di", @@ -37,20 +37,7 @@ "Tests\\E2E\\": "tests/e2e" } }, - "scripts": { - "lint": [ - "vendor/bin/pint --test" - ], - "format": [ - "vendor/bin/pint" - ], - "check": [ - "vendor/bin/phpstan analyse -c phpstan.neon" - ], - "test": [ - "vendor/bin/phpunit --configuration phpunit.xml" - ] - }, + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -62,8 +49,8 @@ "upf" ], "support": { - "source": "https://github.com/utopia-php/di/tree/0.1.0", - "issues": "https://github.com/utopia-php/di/issues" + "issues": "https://github.com/utopia-php/di/issues", + "source": "https://github.com/utopia-php/di/tree/0.1.0" }, "time": "2024-08-08T14:35:19+00:00" }, @@ -146,25 +133,7 @@ "Utopia\\Servers\\": "src/Servers" } }, - "autoload-dev": { - "psr-4": { - "Tests\\E2E\\": "tests/Servers/Unit" - } - }, - "scripts": { - "test": [ - "phpunit" - ], - "analyse": [ - "vendor/bin/phpstan analyse" - ], - "format": [ - "vendor/bin/pint" - ], - "lint": [ - "vendor/bin/pint --test" - ] - }, + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -183,8 +152,8 @@ "utopia" ], "support": { - "source": "https://github.com/utopia-php/servers/tree/0.1.0", - "issues": "https://github.com/utopia-php/servers/issues" + "issues": "https://github.com/utopia-php/servers/issues", + "source": "https://github.com/utopia-php/servers/tree/0.1.0" }, "time": "2024-08-08T14:31:39+00:00" } @@ -571,12 +540,12 @@ "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "3232b2f67faebe6b7ea54d68fb62223914ce35da" + "reference": "f09d3ef93daba9ecb7ab816a0f5fb7ef1d98ef93" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/3232b2f67faebe6b7ea54d68fb62223914ce35da", - "reference": "3232b2f67faebe6b7ea54d68fb62223914ce35da", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/f09d3ef93daba9ecb7ab816a0f5fb7ef1d98ef93", + "reference": "f09d3ef93daba9ecb7ab816a0f5fb7ef1d98ef93", "shasum": "" }, "require": { @@ -622,7 +591,7 @@ "type": "github" } ], - "time": "2024-08-08T11:38:51+00:00" + "time": "2024-08-09T11:29:11+00:00" }, { "name": "phpunit/php-code-coverage", @@ -2016,12 +1985,12 @@ "source": { "type": "git", "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", - "reference": "638cfb69ad6819e3d2e479c9523b879f771b2ef7" + "reference": "c76678afc7da432360a25f499c4035d1df9cae54" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/638cfb69ad6819e3d2e479c9523b879f771b2ef7", - "reference": "638cfb69ad6819e3d2e479c9523b879f771b2ef7", + "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/c76678afc7da432360a25f499c4035d1df9cae54", + "reference": "c76678afc7da432360a25f499c4035d1df9cae54", "shasum": "" }, "require": { @@ -2089,7 +2058,7 @@ "type": "open_collective" } ], - "time": "2024-08-05T00:27:27+00:00" + "time": "2024-08-09T16:49:33+00:00" }, { "name": "swoole/ide-helper", From 2862d9064cf06df69169c3c35ca4b3174a2e043f Mon Sep 17 00:00:00 2001 From: Binyamin Yawitz <316103+byawitz@users.noreply.github.com> Date: Thu, 5 Sep 2024 11:44:20 -0400 Subject: [PATCH 13/13] chore: updating versions --- composer.lock | 69 +++++++++++++++++++++++++-------------------------- 1 file changed, 34 insertions(+), 35 deletions(-) diff --git a/composer.lock b/composer.lock index 411104b..ec504f1 100644 --- a/composer.lock +++ b/composer.lock @@ -56,22 +56,22 @@ }, { "name": "utopia-php/framework", - "version": "1.0.0-RC2", + "version": "1.0.0", "source": { "type": "git", "url": "https://github.com/utopia-php/http.git", - "reference": "d1e9674dbf33bed03fa53854ec1f2c6e074cf4d7" + "reference": "cc880ec41f7f163d4f9956fec26cc6be51b412cf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/http/zipball/d1e9674dbf33bed03fa53854ec1f2c6e074cf4d7", - "reference": "d1e9674dbf33bed03fa53854ec1f2c6e074cf4d7", + "url": "https://api.github.com/repos/utopia-php/http/zipball/cc880ec41f7f163d4f9956fec26cc6be51b412cf", + "reference": "cc880ec41f7f163d4f9956fec26cc6be51b412cf", "shasum": "" }, "require": { "ext-swoole": "*", "php": ">=8.0", - "utopia-php/servers": "0.1.* " + "utopia-php/servers": "0.1.*" }, "require-dev": { "ext-xdebug": "*", @@ -100,9 +100,9 @@ ], "support": { "issues": "https://github.com/utopia-php/http/issues", - "source": "https://github.com/utopia-php/http/tree/1.0.0-RC2" + "source": "https://github.com/utopia-php/http/tree/1.0.0" }, - "time": "2024-08-08T14:46:41+00:00" + "time": "2024-09-05T15:38:08+00:00" }, { "name": "utopia-php/servers", @@ -540,12 +540,12 @@ "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "f09d3ef93daba9ecb7ab816a0f5fb7ef1d98ef93" + "reference": "99756056e2447c92b9e9e24801d17a97b415ead6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/f09d3ef93daba9ecb7ab816a0f5fb7ef1d98ef93", - "reference": "f09d3ef93daba9ecb7ab816a0f5fb7ef1d98ef93", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/99756056e2447c92b9e9e24801d17a97b415ead6", + "reference": "99756056e2447c92b9e9e24801d17a97b415ead6", "shasum": "" }, "require": { @@ -554,7 +554,6 @@ "conflict": { "phpstan/phpstan-shim": "*" }, - "default-branch": true, "bin": [ "phpstan", "phpstan.phar" @@ -591,7 +590,7 @@ "type": "github" } ], - "time": "2024-08-09T11:29:11+00:00" + "time": "2024-09-05T15:27:23+00:00" }, { "name": "phpunit/php-code-coverage", @@ -599,28 +598,28 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "328a747f499cca790acff5634a4e55b957f40634" + "reference": "85402a822d1ecf1db1096959413d35e1c37cf1a5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/328a747f499cca790acff5634a4e55b957f40634", - "reference": "328a747f499cca790acff5634a4e55b957f40634", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/85402a822d1ecf1db1096959413d35e1c37cf1a5", + "reference": "85402a822d1ecf1db1096959413d35e1c37cf1a5", "shasum": "" }, "require": { "ext-dom": "*", "ext-libxml": "*", "ext-xmlwriter": "*", - "nikic/php-parser": "^4.18 || ^5.0", + "nikic/php-parser": "^4.19.1 || ^5.1.0", "php": ">=7.3", - "phpunit/php-file-iterator": "^3.0.3", - "phpunit/php-text-template": "^2.0.2", - "sebastian/code-unit-reverse-lookup": "^2.0.2", - "sebastian/complexity": "^2.0", - "sebastian/environment": "^5.1.2", - "sebastian/lines-of-code": "^1.0.3", - "sebastian/version": "^3.0.1", - "theseer/tokenizer": "^1.2.0" + "phpunit/php-file-iterator": "^3.0.6", + "phpunit/php-text-template": "^2.0.4", + "sebastian/code-unit-reverse-lookup": "^2.0.3", + "sebastian/complexity": "^2.0.3", + "sebastian/environment": "^5.1.5", + "sebastian/lines-of-code": "^1.0.4", + "sebastian/version": "^3.0.2", + "theseer/tokenizer": "^1.2.3" }, "require-dev": { "phpunit/phpunit": "^9.6" @@ -661,7 +660,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.32" }, "funding": [ { @@ -669,7 +668,7 @@ "type": "github" } ], - "time": "2024-07-17T05:19:21+00:00" + "time": "2024-08-22T04:23:01+00:00" }, { "name": "phpunit/php-file-iterator", @@ -918,12 +917,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "0a965f7fb23a19ece6afe7dc4ad0307c11b04d5b" + "reference": "e6a204cd0360ecdb88c200384133df8573abcdb5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/0a965f7fb23a19ece6afe7dc4ad0307c11b04d5b", - "reference": "0a965f7fb23a19ece6afe7dc4ad0307c11b04d5b", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/e6a204cd0360ecdb88c200384133df8573abcdb5", + "reference": "e6a204cd0360ecdb88c200384133df8573abcdb5", "shasum": "" }, "require": { @@ -938,7 +937,7 @@ "phar-io/manifest": "^2.0.4", "phar-io/version": "^3.2.1", "php": ">=7.3", - "phpunit/php-code-coverage": "^9.2.31", + "phpunit/php-code-coverage": "^9.2.32", "phpunit/php-file-iterator": "^3.0.6", "phpunit/php-invoker": "^3.1.1", "phpunit/php-text-template": "^2.0.4", @@ -1013,7 +1012,7 @@ "type": "tidelift" } ], - "time": "2024-08-08T11:55:08+00:00" + "time": "2024-09-04T06:06:52+00:00" }, { "name": "sebastian/cli-parser", @@ -1985,12 +1984,12 @@ "source": { "type": "git", "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", - "reference": "c76678afc7da432360a25f499c4035d1df9cae54" + "reference": "f9052410eb9898a3f1780278bb080dfb930b7fe9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/c76678afc7da432360a25f499c4035d1df9cae54", - "reference": "c76678afc7da432360a25f499c4035d1df9cae54", + "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/f9052410eb9898a3f1780278bb080dfb930b7fe9", + "reference": "f9052410eb9898a3f1780278bb080dfb930b7fe9", "shasum": "" }, "require": { @@ -2058,7 +2057,7 @@ "type": "open_collective" } ], - "time": "2024-08-09T16:49:33+00:00" + "time": "2024-09-02T13:22:27+00:00" }, { "name": "swoole/ide-helper",