From 90f8e5355401c45564dfe6ed10079ca372dd362f Mon Sep 17 00:00:00 2001 From: Prince Dorcis Date: Fri, 16 Apr 2021 12:10:02 +0000 Subject: [PATCH 01/45] Moved response method to Response trait --- src/Menu/BaseMenu.php | 10 ---------- src/Menu/Traits/Response.php | 10 ++++++++++ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/Menu/BaseMenu.php b/src/Menu/BaseMenu.php index 858cb69..5707172 100644 --- a/src/Menu/BaseMenu.php +++ b/src/Menu/BaseMenu.php @@ -256,16 +256,6 @@ public function setApp(Kernel $app) return $this; } - /** - * Get the raw response of the user for this menu. - * - * @return Response - */ - public function response() - { - return $this->app->response(); - } - /** * Get the raw response of the user for this menu. * diff --git a/src/Menu/Traits/Response.php b/src/Menu/Traits/Response.php index 95f6741..dec8c26 100644 --- a/src/Menu/Traits/Response.php +++ b/src/Menu/Traits/Response.php @@ -7,6 +7,16 @@ */ trait Response { + /** + * Instance of the response to send back to the user. + * + * @return Response + */ + public function response() + { + return $this->app->response(); + } + /** * Convert message to string if it is not. * From 2234cca7e50b1beea34fb7405b4b4453e7abaf3b Mon Sep 17 00:00:00 2001 From: Prince Dorcis Date: Fri, 16 Apr 2021 12:24:23 +0000 Subject: [PATCH 02/45] Remove magic call method --- src/Foundation/Kernel.php | 7 +------ src/Menu/BaseMenu.php | 12 ------------ 2 files changed, 1 insertion(+), 18 deletions(-) diff --git a/src/Foundation/Kernel.php b/src/Foundation/Kernel.php index 16cf908..7bc83e7 100644 --- a/src/Foundation/Kernel.php +++ b/src/Foundation/Kernel.php @@ -247,7 +247,7 @@ public function __construct($appName = '', $forcedInput = []) ob_start(); $this->appName = $appName; $this->forcedInput = $forcedInput; - $this->path = new Path; + $this->path = new Path(); $this->logger = new Log( $this->path('app_default_log_file'), $this->path('app_default_cache_file') @@ -562,7 +562,6 @@ public function isMovingToMenu($nextMenu) * developer has to specify the validation rules or validate himself in the * `validate` method of the menu entity) * - * @param string $currentMenu * @param string $userError * @param bool $responseExistsInMenuActions The response has already been specified by the developer * @param string $nextMenu @@ -1739,7 +1738,6 @@ public function setError(string $error = '') /** * Retrieve the request input. * - * * @param string $name * * @return mixed @@ -1809,7 +1807,6 @@ public function userSavedResponse() * The sender name and endpoint can be configure in the env file or * directly in the config/app.php file * - * * @param string $message * @param string $msisdn * @param string $senderName @@ -1831,8 +1828,6 @@ public function sendSms($message, $msisdn = '', $senderName = '', $endpoint = '' /** * Return a path to a file or a folder. * - * - * * @param string $key * * @throws \RuntimeException diff --git a/src/Menu/BaseMenu.php b/src/Menu/BaseMenu.php index 5707172..2f40df6 100644 --- a/src/Menu/BaseMenu.php +++ b/src/Menu/BaseMenu.php @@ -328,9 +328,6 @@ public function mustNotTimeout() /** * Return the user previous responses. * - * @param string $menuName The name of the menu response to retrieve - * @param string $default The default to pass when no response has been found for the menu provided - * * @return UserResponse|mixed */ public function previousResponses(...$args) @@ -402,15 +399,6 @@ public function hasResumeFromLastSession() return $this->app->hasResumeFromLastSession(); } - // public function __call($method, $args) - // { - // if (method_exists($this->app, $method)) { - // return call_user_func([$this->app, $method], ...$args); - // } - - // throw new \BadMethodCallException('Undefined method `'.$method.'` in class '.get_class($this)); - // } - // ArrayAccess Interface public function offsetExists($offset) { From 1984768e85c0ccd4a7c267a5624008196a4c2785 Mon Sep 17 00:00:00 2001 From: Prince Dorcis Date: Fri, 16 Apr 2021 13:44:48 +0000 Subject: [PATCH 03/45] Fix hasResumeFromLastSession to hasResumedFromLastSession and andd hasJustResumedFromLastSession --- src/Foundation/Kernel.php | 10 +++++----- src/Menu/BaseMenu.php | 13 +++++++++---- src/Menu/Paginator.php | 2 +- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/src/Foundation/Kernel.php b/src/Foundation/Kernel.php index 7bc83e7..ffc89c2 100644 --- a/src/Foundation/Kernel.php +++ b/src/Foundation/Kernel.php @@ -229,7 +229,7 @@ class Kernel * * @var bool */ - protected $hasResumeFromLastSession = false; + protected $hasResumedFromLastSession = false; protected $menuNamespaceDelimiter = '::'; @@ -424,7 +424,7 @@ public function hasComeBackAfterNoTimeoutFinalResponse() protected function runLastSessionState() { - $this->hasResumeFromLastSession = true; + $this->hasResumedFromLastSession = true; $this->sessionSave('has_resume_from_last_session', true); $this->saveCurrentMenuName($this->historyBagPop()); $this->runState($this->currentMenuName()); @@ -1850,12 +1850,12 @@ public function logger() return $this->logger; } - public function hasResumeFromLastSessionOnThisMenu() + public function hasResumedFromLastSessionOnThisMenu() { - return $this->hasResumeFromLastSession; + return $this->hasResumedFromLastSession; } - public function hasResumeFromLastSession() + public function hasResumedFromLastSession() { return $this->session('has_resume_from_last_session', null); } diff --git a/src/Menu/BaseMenu.php b/src/Menu/BaseMenu.php index 2f40df6..67614bd 100644 --- a/src/Menu/BaseMenu.php +++ b/src/Menu/BaseMenu.php @@ -389,14 +389,19 @@ public function db($name = '') return $this->app->db($name); } - public function hasResumeFromLastSessionOnThisMenu() + public function hasResumedFromLastSessionOnThisMenu() { - return $this->app->hasResumeFromLastSession(); + return $this->hasResumedFromLastSessionOnThisMenu(); } - public function hasResumeFromLastSession() + public function hasJustResumedFromLastSession() { - return $this->app->hasResumeFromLastSession(); + return $this->app->hasResumedFromLastSessionOnThisMenu(); + } + + public function hasResumedFromLastSession() + { + return $this->app->hasResumedFromLastSession(); } // ArrayAccess Interface diff --git a/src/Menu/Paginator.php b/src/Menu/Paginator.php index 7332639..6f86df0 100644 --- a/src/Menu/Paginator.php +++ b/src/Menu/Paginator.php @@ -56,7 +56,7 @@ public function before() public function handlePagination() { - if ($this->hasResumeFromLastSessionOnThisMenu() || !empty($this->error())) { + if ($this->hasResumedFromLastSessionOnThisMenu() || !empty($this->error())) { $this->moveFetchCursorBackOnce(); } From 84fa218dfaff64f1ad023510b8c284b13133533d Mon Sep 17 00:00:00 2001 From: Prince Dorcis Date: Fri, 16 Apr 2021 13:53:58 +0000 Subject: [PATCH 04/45] Changed anything lastSession/last_session/LastSession/LAST_SESSION to equivalent previousSession --- config/app.php | 6 +++--- config/menu.php | 6 +++--- constants.php | 14 ++++++------- src/Foundation/Kernel.php | 44 +++++++++++++++++++-------------------- src/Menu/BaseMenu.php | 12 +++++------ src/Menu/Menus.php | 20 +++++++++--------- src/Menu/Paginator.php | 2 +- 7 files changed, 52 insertions(+), 52 deletions(-) diff --git a/config/app.php b/config/app.php index d2f41cf..6cb4037 100644 --- a/config/app.php +++ b/config/app.php @@ -64,12 +64,12 @@ /* * This option works with the `always_start_new_session` option. If true * and always_start_new_session has been set to false, the user will have a - * prompt to continue their last session or restart a new session. If - * false, the last session will be automatically loaded whenever the user + * prompt to continue their previous session or restart a new session. If + * false, the previous session will be automatically loaded whenever the user * comes back. * This does not have any effect if always_start_new_session is set to true. */ - 'ask_user_before_reload_last_session' => true, + 'ask_user_before_reload_previous_session' => true, /* * USSD sessions times out very quickly depending on the network and the diff --git a/config/menu.php b/config/menu.php index 1bb026f..5b93b63 100644 --- a/config/menu.php +++ b/config/menu.php @@ -2,11 +2,11 @@ return [ - 'message_ask_user_before_reload_last_session' => 'Do you want to continue from where you left?', + 'message_ask_user_before_reload_previous_session' => 'Do you want to continue from where you left?', - 'last_session_trigger' => '1', + 'previous_session_trigger' => '1', - 'last_session_display' => 'Continue last session', + 'previous_session_display' => 'Continue previous session', 'restart_session_trigger' => '2', diff --git a/constants.php b/constants.php index 62042c3..548f273 100644 --- a/constants.php +++ b/constants.php @@ -28,11 +28,11 @@ define('APP_REQUEST_ASK_USER_RESPONSE', $config->get('app.request_ask_user_response')); define('APP_REQUEST_USER_SENT_RESPONSE', $config->get('app.request_user_sent_response')); define( - 'APP_REQUEST_ASK_USER_BEFORE_RELOAD_LAST_SESSION', + 'APP_REQUEST_ASK_USER_BEFORE_RELOAD_PREVIOUS_SESSION', '__CUSTOM_REQUEST_TYPE1' ); define( - 'APP_REQUEST_RELOAD_LAST_SESSION_DIRECTLY', + 'APP_REQUEST_RELOAD_PREVIOUS_SESSION_DIRECTLY', '__CUSTOM_REQUEST_TYPE2' ); @@ -55,7 +55,7 @@ define('APP_END', '__end'); define('APP_SPLITTED_MENU_NEXT', '__split_next'); define('APP_SPLITTED_MENU_BACK', '__split_back'); -define('APP_CONTINUE_LAST_SESSION', '__continue_last_session'); +define('APP_CONTINUE_PREVIOUS_SESSION', '__continue_previous_session'); define('APP_PAGINATE_FORWARD', '__paginate_forward'); define('APP_PAGINATE_BACK', '__paginate_back'); @@ -67,7 +67,7 @@ * APP_BACK: throw the previous menu * APP_SAME: re-throw the current menu * APP_END: throw a goodbye menu - * APP_CONTINUE_LAST_SESSION: throw the menu on which the user was before + * APP_CONTINUE_PREVIOUS_SESSION: throw the menu on which the user was before * request timed out or was cancelled */ define('RESERVED_MENU_IDs', [ @@ -75,7 +75,7 @@ APP_END, APP_BACK, APP_SAME, - APP_CONTINUE_LAST_SESSION, + APP_CONTINUE_PREVIOUS_SESSION, APP_SPLITTED_MENU_NEXT, APP_SPLITTED_MENU_BACK, APP_PAGINATE_FORWARD, @@ -99,8 +99,8 @@ define('ALLOWED_REQUEST_CHANNELS', ['USSD', 'WHATSAPP', 'CONSOLE']); define( - 'ASK_USER_BEFORE_RELOAD_LAST_SESSION', - 'ask_user_before_reload_last_session' + 'ASK_USER_BEFORE_RELOAD_PREVIOUS_SESSION', + 'ask_user_before_reload_previous_session' ); define('DEVELOPER_SAVED_DATA', 'session_data_accessible_by_app'); diff --git a/src/Foundation/Kernel.php b/src/Foundation/Kernel.php index ffc89c2..90edb16 100644 --- a/src/Foundation/Kernel.php +++ b/src/Foundation/Kernel.php @@ -103,7 +103,7 @@ class Kernel * Custom request type. * * The custom request type help define a request type for handling restart - * from last session and other requests. + * from previous session and other requests. * * @var string */ @@ -229,7 +229,7 @@ class Kernel * * @var bool */ - protected $hasResumedFromLastSession = false; + protected $hasResumedFromPreviousSession = false; protected $menuNamespaceDelimiter = '::'; @@ -367,12 +367,12 @@ protected function handleUserRequest() break; - case APP_REQUEST_ASK_USER_BEFORE_RELOAD_LAST_SESSION: - $this->runAskUserBeforeReloadLastSessionState(); + case APP_REQUEST_ASK_USER_BEFORE_RELOAD_PREVIOUS_SESSION: + $this->runAskUserBeforeReloadPreviousSessionState(); break; - case APP_REQUEST_RELOAD_LAST_SESSION_DIRECTLY: - $this->runLastSessionState(); + case APP_REQUEST_RELOAD_PREVIOUS_SESSION_DIRECTLY: + $this->runPreviousSessionState(); break; case APP_REQUEST_CANCELLED: @@ -408,12 +408,12 @@ public function doesNotAllowDirectSubMenuCall() public function prepareToLaunchFromPreviousSession() { if ( - $this->config('app.ask_user_before_reload_last_session') && + $this->config('app.ask_user_before_reload_previous_session') && $this->session->metadata('current_menu_name', false) !== WELCOME_MENU_NAME ) { - $this->setCustomUssdRequestType(APP_REQUEST_ASK_USER_BEFORE_RELOAD_LAST_SESSION); + $this->setCustomUssdRequestType(APP_REQUEST_ASK_USER_BEFORE_RELOAD_PREVIOUS_SESSION); } else { - $this->setCustomUssdRequestType(APP_REQUEST_RELOAD_LAST_SESSION_DIRECTLY); + $this->setCustomUssdRequestType(APP_REQUEST_RELOAD_PREVIOUS_SESSION_DIRECTLY); } } @@ -422,10 +422,10 @@ public function hasComeBackAfterNoTimeoutFinalResponse() return $this->session->mustNotTimeout() && $this->session->isNew(); } - protected function runLastSessionState() + protected function runPreviousSessionState() { - $this->hasResumedFromLastSession = true; - $this->sessionSave('has_resume_from_last_session', true); + $this->hasResumedFromPreviousSession = true; + $this->sessionSave('has_resume_from_previous_session', true); $this->saveCurrentMenuName($this->historyBagPop()); $this->runState($this->currentMenuName()); } @@ -440,9 +440,9 @@ protected function saveCurrentMenuName($name) $this->session->setMetadata('current_menu_name', $name); } - protected function runAskUserBeforeReloadLastSessionState() + protected function runAskUserBeforeReloadPreviousSessionState() { - $this->runState(ASK_USER_BEFORE_RELOAD_LAST_SESSION); + $this->runState(ASK_USER_BEFORE_RELOAD_PREVIOUS_SESSION); } protected function processResponse() @@ -624,8 +624,8 @@ protected function runAppropriateState($nextMenu) $this->runSameState(); break; - case APP_CONTINUE_LAST_SESSION: - $this->runLastSessionState(); + case APP_CONTINUE_PREVIOUS_SESSION: + $this->runPreviousSessionState(); break; case APP_PAGINATE_FORWARD: @@ -1140,12 +1140,12 @@ protected function runNextState( if (APP_SPLITTED_MENU_NEXT !== $nextMenuName && APP_SPLITTED_MENU_BACK !== $nextMenuName) { if ( $this->currentMenuName() && - $this->currentMenuName() !== WELCOME_MENU_NAME && ASK_USER_BEFORE_RELOAD_LAST_SESSION !== $nextMenuName && + $this->currentMenuName() !== WELCOME_MENU_NAME && ASK_USER_BEFORE_RELOAD_PREVIOUS_SESSION !== $nextMenuName && !empty($this->historyBag()) && $this->previousMenuName() === $nextMenuName) { $this->historyBagPop(); } elseif ( $this->currentMenuName() && $this->currentMenuName() !== $nextMenuName && - $this->currentMenuName() !== ASK_USER_BEFORE_RELOAD_LAST_SESSION + $this->currentMenuName() !== ASK_USER_BEFORE_RELOAD_PREVIOUS_SESSION ) { $this->historyBagPush($this->currentMenuName()); } @@ -1850,13 +1850,13 @@ public function logger() return $this->logger; } - public function hasResumedFromLastSessionOnThisMenu() + public function hasResumedFromPreviousSessionOnThisMenu() { - return $this->hasResumedFromLastSession; + return $this->hasResumedFromPreviousSession; } - public function hasResumedFromLastSession() + public function hasResumedFromPreviousSession() { - return $this->session('has_resume_from_last_session', null); + return $this->session('has_resume_from_previous_session', null); } } diff --git a/src/Menu/BaseMenu.php b/src/Menu/BaseMenu.php index 67614bd..59faa51 100644 --- a/src/Menu/BaseMenu.php +++ b/src/Menu/BaseMenu.php @@ -389,19 +389,19 @@ public function db($name = '') return $this->app->db($name); } - public function hasResumedFromLastSessionOnThisMenu() + public function hasResumedFromPreviousSessionOnThisMenu() { - return $this->hasResumedFromLastSessionOnThisMenu(); + return $this->hasResumedFromPreviousSessionOnThisMenu(); } - public function hasJustResumedFromLastSession() + public function hasJustResumedFromPreviousSession() { - return $this->app->hasResumedFromLastSessionOnThisMenu(); + return $this->app->hasResumedFromPreviousSessionOnThisMenu(); } - public function hasResumedFromLastSession() + public function hasResumedFromPreviousSession() { - return $this->app->hasResumedFromLastSession(); + return $this->app->hasResumedFromPreviousSession(); } // ArrayAccess Interface diff --git a/src/Menu/Menus.php b/src/Menu/Menus.php index 4131657..6e72e14 100644 --- a/src/Menu/Menus.php +++ b/src/Menu/Menus.php @@ -93,29 +93,29 @@ public function hydrateMenus($app) $this->insertMenuActions($modifications, $app->currentMenuName()); } - if ($app->config('app.ask_user_before_reload_last_session')) { + if ($app->config('app.ask_user_before_reload_previous_session')) { $this->menus = array_merge( $this->menus, - $this->menuAskUserBeforeReloadLastSession() + $this->menuAskUserBeforeReloadPreviousSession() ); } } - public function menuAskUserBeforeReloadLastSession() + public function menuAskUserBeforeReloadPreviousSession() { - $message = $this->app->config('menu.message_ask_user_before_reload_last_session'); - $lastSessionTrigger = $this->app->config('menu.last_session_trigger'); - $lastSessionDisplay = $this->app->config('menu.last_session_display'); + $message = $this->app->config('menu.message_ask_user_before_reload_previous_session'); + $previousSessionTrigger = $this->app->config('menu.previous_session_trigger'); + $previousSessionDisplay = $this->app->config('menu.previous_session_display'); $restartSessionTrigger = $this->app->config('menu.restart_session_trigger'); $restartSessionDisplay = $this->app->config('menu.restart_session_display'); return [ - ASK_USER_BEFORE_RELOAD_LAST_SESSION => [ + ASK_USER_BEFORE_RELOAD_PREVIOUS_SESSION => [ 'message' => $message, 'actions' => [ - $lastSessionTrigger => [ - ITEM_MSG => $lastSessionDisplay, - ITEM_ACTION => APP_CONTINUE_LAST_SESSION, + $previousSessionTrigger => [ + ITEM_MSG => $previousSessionDisplay, + ITEM_ACTION => APP_CONTINUE_PREVIOUS_SESSION, ], $restartSessionTrigger => [ ITEM_MSG => $restartSessionDisplay, diff --git a/src/Menu/Paginator.php b/src/Menu/Paginator.php index 6f86df0..edf13d6 100644 --- a/src/Menu/Paginator.php +++ b/src/Menu/Paginator.php @@ -56,7 +56,7 @@ public function before() public function handlePagination() { - if ($this->hasResumedFromLastSessionOnThisMenu() || !empty($this->error())) { + if ($this->hasResumedFromPreviousSessionOnThisMenu() || !empty($this->error())) { $this->moveFetchCursorBackOnce(); } From ceab3a00b661e212f7b287f2b33c16d06c2e0a06 Mon Sep 17 00:00:00 2001 From: Prince Dorcis Date: Fri, 16 Apr 2021 14:22:45 +0000 Subject: [PATCH 05/45] Fixed session has passed calculation --- src/Session/Session.php | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/Session/Session.php b/src/Session/Session.php index 3c829f8..ae992cb 100644 --- a/src/Session/Session.php +++ b/src/Session/Session.php @@ -123,12 +123,7 @@ public function hasPassed($type) $lastConnection = $this->data['__last_connection'] ?? 0; $now = microtime(true); - return $this->secondsToMinutes($now - $lastConnection) >= $allowed; - } - - public function secondsToMinutes($sec) - { - return $sec / 60; + return ($now - $lastConnection) >= $allowed; } public function mustNotTimeout() From 95e7ed86d09ea36e881575acd3fc72bdaa508b5f Mon Sep 17 00:00:00 2001 From: Prince Dorcis Date: Fri, 16 Apr 2021 16:27:16 +0000 Subject: [PATCH 06/45] Fix hasJustResumedFromPreviousSession --- composer.lock | 4125 ++++++++++++++++++++++++++++++ src/Menu/BaseMenu.php | 21 +- src/Session/DatabaseSession.php | 2 +- src/Session/FileSession.php | 2 +- src/Session/Session.php | 110 +- src/Session/SessionInterface.php | 24 +- 6 files changed, 4196 insertions(+), 88 deletions(-) create mode 100644 composer.lock diff --git a/composer.lock b/composer.lock new file mode 100644 index 0000000..540c5a2 --- /dev/null +++ b/composer.lock @@ -0,0 +1,4125 @@ +{ + "_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": "ae6d0ee97623e98a3df7999a2520d887", + "packages": [ + { + "name": "doctrine/inflector", + "version": "2.0.3", + "source": { + "type": "git", + "url": "https://github.com/doctrine/inflector.git", + "reference": "9cf661f4eb38f7c881cac67c75ea9b00bf97b210" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/inflector/zipball/9cf661f4eb38f7c881cac67c75ea9b00bf97b210", + "reference": "9cf661f4eb38f7c881cac67c75ea9b00bf97b210", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "require-dev": { + "doctrine/coding-standard": "^7.0", + "phpstan/phpstan": "^0.11", + "phpstan/phpstan-phpunit": "^0.11", + "phpstan/phpstan-strict-rules": "^0.11", + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Doctrine\\Inflector\\": "lib/Doctrine/Inflector" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Guilherme Blanco", + "email": "guilhermeblanco@gmail.com" + }, + { + "name": "Roman Borschel", + "email": "roman@code-factory.org" + }, + { + "name": "Benjamin Eberlei", + "email": "kontakt@beberlei.de" + }, + { + "name": "Jonathan Wage", + "email": "jonwage@gmail.com" + }, + { + "name": "Johannes Schmitt", + "email": "schmittjoh@gmail.com" + } + ], + "description": "PHP Doctrine Inflector is a small library that can perform string manipulations with regard to upper/lowercase and singular/plural forms of words.", + "homepage": "https://www.doctrine-project.org/projects/inflector.html", + "keywords": [ + "inflection", + "inflector", + "lowercase", + "manipulation", + "php", + "plural", + "singular", + "strings", + "uppercase", + "words" + ], + "support": { + "issues": "https://github.com/doctrine/inflector/issues", + "source": "https://github.com/doctrine/inflector/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%2Finflector", + "type": "tidelift" + } + ], + "time": "2020-05-29T15:13:26+00:00" + }, + { + "name": "illuminate/collections", + "version": "v8.37.0", + "source": { + "type": "git", + "url": "https://github.com/illuminate/collections.git", + "reference": "591e31015a8b0731708c54411cb52d50a00b2bc3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/illuminate/collections/zipball/591e31015a8b0731708c54411cb52d50a00b2bc3", + "reference": "591e31015a8b0731708c54411cb52d50a00b2bc3", + "shasum": "" + }, + "require": { + "illuminate/contracts": "^8.0", + "illuminate/macroable": "^8.0", + "php": "^7.3|^8.0" + }, + "suggest": { + "symfony/var-dumper": "Required to use the dump method (^5.1.4)." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "8.x-dev" + } + }, + "autoload": { + "psr-4": { + "Illuminate\\Support\\": "" + }, + "files": [ + "helpers.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "The Illuminate Collections package.", + "homepage": "https://laravel.com", + "support": { + "issues": "https://github.com/laravel/framework/issues", + "source": "https://github.com/laravel/framework" + }, + "time": "2021-04-01T13:26:52+00:00" + }, + { + "name": "illuminate/container", + "version": "v8.37.0", + "source": { + "type": "git", + "url": "https://github.com/illuminate/container.git", + "reference": "0e38ee1632d470e56aece0079e6e22d13e6bea8e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/illuminate/container/zipball/0e38ee1632d470e56aece0079e6e22d13e6bea8e", + "reference": "0e38ee1632d470e56aece0079e6e22d13e6bea8e", + "shasum": "" + }, + "require": { + "illuminate/contracts": "^8.0", + "php": "^7.3|^8.0", + "psr/container": "^1.0" + }, + "provide": { + "psr/container-implementation": "1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "8.x-dev" + } + }, + "autoload": { + "psr-4": { + "Illuminate\\Container\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "The Illuminate Container package.", + "homepage": "https://laravel.com", + "support": { + "issues": "https://github.com/laravel/framework/issues", + "source": "https://github.com/laravel/framework" + }, + "time": "2021-03-16T19:42:20+00:00" + }, + { + "name": "illuminate/contracts", + "version": "v8.37.0", + "source": { + "type": "git", + "url": "https://github.com/illuminate/contracts.git", + "reference": "5764f703ea8f74ced163125d810951cd5ef2b7e1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/illuminate/contracts/zipball/5764f703ea8f74ced163125d810951cd5ef2b7e1", + "reference": "5764f703ea8f74ced163125d810951cd5ef2b7e1", + "shasum": "" + }, + "require": { + "php": "^7.3|^8.0", + "psr/container": "^1.0", + "psr/simple-cache": "^1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "8.x-dev" + } + }, + "autoload": { + "psr-4": { + "Illuminate\\Contracts\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "The Illuminate Contracts package.", + "homepage": "https://laravel.com", + "support": { + "issues": "https://github.com/laravel/framework/issues", + "source": "https://github.com/laravel/framework" + }, + "time": "2021-04-01T13:09:31+00:00" + }, + { + "name": "illuminate/database", + "version": "v8.37.0", + "source": { + "type": "git", + "url": "https://github.com/illuminate/database.git", + "reference": "a9d9c78c705bc64e92a61c33453ebbcad6dd5f29" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/illuminate/database/zipball/a9d9c78c705bc64e92a61c33453ebbcad6dd5f29", + "reference": "a9d9c78c705bc64e92a61c33453ebbcad6dd5f29", + "shasum": "" + }, + "require": { + "ext-json": "*", + "illuminate/collections": "^8.0", + "illuminate/container": "^8.0", + "illuminate/contracts": "^8.0", + "illuminate/macroable": "^8.0", + "illuminate/support": "^8.0", + "php": "^7.3|^8.0", + "symfony/console": "^5.1.4" + }, + "suggest": { + "doctrine/dbal": "Required to rename columns and drop SQLite columns (^2.6|^3.0).", + "fakerphp/faker": "Required to use the eloquent factory builder (^1.9.1).", + "illuminate/console": "Required to use the database commands (^8.0).", + "illuminate/events": "Required to use the observers with Eloquent (^8.0).", + "illuminate/filesystem": "Required to use the migrations (^8.0).", + "illuminate/pagination": "Required to paginate the result set (^8.0).", + "symfony/finder": "Required to use Eloquent model factories (^5.1.4)." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "8.x-dev" + } + }, + "autoload": { + "psr-4": { + "Illuminate\\Database\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "The Illuminate Database package.", + "homepage": "https://laravel.com", + "keywords": [ + "database", + "laravel", + "orm", + "sql" + ], + "support": { + "issues": "https://github.com/laravel/framework/issues", + "source": "https://github.com/laravel/framework" + }, + "time": "2021-04-13T13:40:36+00:00" + }, + { + "name": "illuminate/macroable", + "version": "v8.37.0", + "source": { + "type": "git", + "url": "https://github.com/illuminate/macroable.git", + "reference": "300aa13c086f25116b5f3cde3ca54ff5c822fb05" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/illuminate/macroable/zipball/300aa13c086f25116b5f3cde3ca54ff5c822fb05", + "reference": "300aa13c086f25116b5f3cde3ca54ff5c822fb05", + "shasum": "" + }, + "require": { + "php": "^7.3|^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "8.x-dev" + } + }, + "autoload": { + "psr-4": { + "Illuminate\\Support\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "The Illuminate Macroable package.", + "homepage": "https://laravel.com", + "support": { + "issues": "https://github.com/laravel/framework/issues", + "source": "https://github.com/laravel/framework" + }, + "time": "2020-10-27T15:20:30+00:00" + }, + { + "name": "illuminate/support", + "version": "v8.37.0", + "source": { + "type": "git", + "url": "https://github.com/illuminate/support.git", + "reference": "074a9b7adefcdd7108e19faa96bc9dacfe922062" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/illuminate/support/zipball/074a9b7adefcdd7108e19faa96bc9dacfe922062", + "reference": "074a9b7adefcdd7108e19faa96bc9dacfe922062", + "shasum": "" + }, + "require": { + "doctrine/inflector": "^1.4|^2.0", + "ext-json": "*", + "ext-mbstring": "*", + "illuminate/collections": "^8.0", + "illuminate/contracts": "^8.0", + "illuminate/macroable": "^8.0", + "nesbot/carbon": "^2.31", + "php": "^7.3|^8.0", + "voku/portable-ascii": "^1.4.8" + }, + "conflict": { + "tightenco/collect": "<5.5.33" + }, + "suggest": { + "illuminate/filesystem": "Required to use the composer class (^8.0).", + "league/commonmark": "Required to use Str::markdown() and Stringable::markdown() (^1.3).", + "ramsey/uuid": "Required to use Str::uuid() (^4.0).", + "symfony/process": "Required to use the composer class (^5.1.4).", + "symfony/var-dumper": "Required to use the dd function (^5.1.4).", + "vlucas/phpdotenv": "Required to use the Env class and env helper (^5.2)." + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "8.x-dev" + } + }, + "autoload": { + "psr-4": { + "Illuminate\\Support\\": "" + }, + "files": [ + "helpers.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Otwell", + "email": "taylor@laravel.com" + } + ], + "description": "The Illuminate Support package.", + "homepage": "https://laravel.com", + "support": { + "issues": "https://github.com/laravel/framework/issues", + "source": "https://github.com/laravel/framework" + }, + "time": "2021-04-11T23:26:41+00:00" + }, + { + "name": "nesbot/carbon", + "version": "2.46.0", + "source": { + "type": "git", + "url": "https://github.com/briannesbitt/Carbon.git", + "reference": "2fd2c4a77d58a4e95234c8a61c5df1f157a91bf4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/2fd2c4a77d58a4e95234c8a61c5df1f157a91bf4", + "reference": "2fd2c4a77d58a4e95234c8a61c5df1f157a91bf4", + "shasum": "" + }, + "require": { + "ext-json": "*", + "php": "^7.1.8 || ^8.0", + "symfony/polyfill-mbstring": "^1.0", + "symfony/translation": "^3.4 || ^4.0 || ^5.0" + }, + "require-dev": { + "doctrine/orm": "^2.7", + "friendsofphp/php-cs-fixer": "^2.14 || ^3.0", + "kylekatarnls/multi-tester": "^2.0", + "phpmd/phpmd": "^2.9", + "phpstan/extension-installer": "^1.0", + "phpstan/phpstan": "^0.12.54", + "phpunit/phpunit": "^7.5.20 || ^8.5.14", + "squizlabs/php_codesniffer": "^3.4" + }, + "bin": [ + "bin/carbon" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.x-dev", + "dev-3.x": "3.x-dev" + }, + "laravel": { + "providers": [ + "Carbon\\Laravel\\ServiceProvider" + ] + }, + "phpstan": { + "includes": [ + "extension.neon" + ] + } + }, + "autoload": { + "psr-4": { + "Carbon\\": "src/Carbon/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Brian Nesbitt", + "email": "brian@nesbot.com", + "homepage": "http://nesbot.com" + }, + { + "name": "kylekatarnls", + "homepage": "http://github.com/kylekatarnls" + } + ], + "description": "An API extension for DateTime that supports 281 different languages.", + "homepage": "http://carbon.nesbot.com", + "keywords": [ + "date", + "datetime", + "time" + ], + "support": { + "issues": "https://github.com/briannesbitt/Carbon/issues", + "source": "https://github.com/briannesbitt/Carbon" + }, + "funding": [ + { + "url": "https://opencollective.com/Carbon", + "type": "open_collective" + }, + { + "url": "https://tidelift.com/funding/github/packagist/nesbot/carbon", + "type": "tidelift" + } + ], + "time": "2021-02-24T17:30:44+00:00" + }, + { + "name": "nikic/php-parser", + "version": "v4.10.4", + "source": { + "type": "git", + "url": "https://github.com/nikic/PHP-Parser.git", + "reference": "c6d052fc58cb876152f89f532b95a8d7907e7f0e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/c6d052fc58cb876152f89f532b95a8d7907e7f0e", + "reference": "c6d052fc58cb876152f89f532b95a8d7907e7f0e", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": ">=7.0" + }, + "require-dev": { + "ircmaxell/php-yacc": "^0.0.7", + "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0" + }, + "bin": [ + "bin/php-parse" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.9-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/v4.10.4" + }, + "time": "2020-12-20T10:01:03+00:00" + }, + { + "name": "prinx/array-utils", + "version": "v0.0.2", + "source": { + "type": "git", + "url": "https://github.com/prinx/php-array-utils.git", + "reference": "b3834cfa24f40c6e283b8dfda81515a513a0ed2a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/prinx/php-array-utils/zipball/b3834cfa24f40c6e283b8dfda81515a513a0ed2a", + "reference": "b3834cfa24f40c6e283b8dfda81515a513a0ed2a", + "shasum": "" + }, + "require-dev": { + "phpunit/phpunit": "9.2.5" + }, + "type": "library", + "autoload": { + "psr-4": { + "Prinx\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Prince Dorcis", + "email": "princedorcis@gmail.com" + } + ], + "description": "PHP arrays utility class", + "support": { + "issues": "https://github.com/prinx/php-array-utils/issues", + "source": "https://github.com/prinx/php-array-utils/tree/v0.0.2" + }, + "time": "2020-10-22T13:25:47+00:00" + }, + { + "name": "prinx/dir-dot-config", + "version": "v0.0.3", + "source": { + "type": "git", + "url": "https://github.com/prinx/php-dir-dot-config.git", + "reference": "d63540f7df8c7e9e67e39add8cea296c90bbc183" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/prinx/php-dir-dot-config/zipball/d63540f7df8c7e9e67e39add8cea296c90bbc183", + "reference": "d63540f7df8c7e9e67e39add8cea296c90bbc183", + "shasum": "" + }, + "require": { + "prinx/array-utils": "^0.0.2" + }, + "require-dev": { + "phpunit/phpunit": "9.2.5" + }, + "type": "library", + "autoload": { + "psr-4": { + "Prinx\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Prince Dorcis", + "email": "princedorcis@gmail.com" + } + ], + "description": "Retrieve configuration from files in configuration directory.", + "support": { + "issues": "https://github.com/prinx/php-dir-dot-config/issues", + "source": "https://github.com/prinx/php-dir-dot-config/tree/v0.0.3" + }, + "time": "2020-10-22T15:30:21+00:00" + }, + { + "name": "prinx/dotenv", + "version": "v0.4.3", + "source": { + "type": "git", + "url": "https://github.com/prinx/dotenv.git", + "reference": "3a36a10035ba319ebc08bdbdbc0dbddce9d556d1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/prinx/dotenv/zipball/3a36a10035ba319ebc08bdbdbc0dbddce9d556d1", + "reference": "3a36a10035ba319ebc08bdbdbc0dbddce9d556d1", + "shasum": "" + }, + "require": { + "php": ">=5.6.0" + }, + "require-dev": { + "nunomaduro/collision": "^5.1", + "phpunit/phpunit": "^9.4" + }, + "type": "library", + "autoload": { + "files": [ + "src/env.php", + "src/env_namespaced.php" + ], + "psr-4": { + "Prinx\\Dotenv\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Prince Damien Dorcis-Akpaglo", + "email": "princedorcis@gmail.com", + "homepage": "https://github.com/prinx", + "role": "Maintainer" + } + ], + "description": "Make easy access to the environment variables in your application", + "homepage": "https://github.com/prinx/dotenv", + "keywords": [ + "dotenv", + "env", + "phpdotenv" + ], + "support": { + "issues": "https://github.com/prinx/dotenv/issues", + "source": "https://github.com/prinx/dotenv/tree/v0.4.3" + }, + "time": "2020-12-01T11:32:50+00:00" + }, + { + "name": "prinx/notify", + "version": "v0.0.4", + "source": { + "type": "git", + "url": "https://github.com/prinx/notify.git", + "reference": "a582a2420b08bc922bb2895c795b880d37ba23d7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/prinx/notify/zipball/a582a2420b08bc922bb2895c795b880d37ba23d7", + "reference": "a582a2420b08bc922bb2895c795b880d37ba23d7", + "shasum": "" + }, + "require": { + "php": ">=5.6.0" + }, + "require-dev": { + "nunomaduro/collision": "^5.1", + "phpunit/phpunit": "^9.2.5" + }, + "type": "library", + "autoload": { + "psr-4": { + "Prinx\\Notify\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Prince Dorcis", + "email": "princedorcis@gmail.com", + "homepage": "https://prinx.github.io", + "role": "Maintainer" + } + ], + "description": "Simple log package", + "homepage": "https://github.com/prinx/notify", + "support": { + "issues": "https://github.com/prinx/notify/issues", + "source": "https://github.com/prinx/notify/tree/v0.0.4" + }, + "time": "2020-11-15T11:01:05+00:00" + }, + { + "name": "prinx/os-utils", + "version": "v0.0.4", + "source": { + "type": "git", + "url": "https://github.com/prinx/php-os-utils.git", + "reference": "ac1c0ce90d8fced53e7a398a1a67ff50730e0ca0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/prinx/php-os-utils/zipball/ac1c0ce90d8fced53e7a398a1a67ff50730e0ca0", + "reference": "ac1c0ce90d8fced53e7a398a1a67ff50730e0ca0", + "shasum": "" + }, + "require": { + "prinx/string-utils": "^0.0.2" + }, + "require-dev": { + "phpunit/phpunit": "9.2.5" + }, + "type": "library", + "autoload": { + "psr-4": { + "Prinx\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Prince Dorcis", + "email": "princedorcis@gmail.com" + } + ], + "description": "Operating system utilities class", + "support": { + "issues": "https://github.com/prinx/php-os-utils/issues", + "source": "https://github.com/prinx/php-os-utils/tree/v0.0.4" + }, + "time": "2020-10-22T15:21:43+00:00" + }, + { + "name": "prinx/phputils", + "version": "v0.0.3", + "source": { + "type": "git", + "url": "https://github.com/prinx/phputils.git", + "reference": "84c3ce1483f6c1db6ad3f4532555b452c4f2064a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/prinx/phputils/zipball/84c3ce1483f6c1db6ad3f4532555b452c4f2064a", + "reference": "84c3ce1483f6c1db6ad3f4532555b452c4f2064a", + "shasum": "" + }, + "require": { + "php": ">=5.1.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Prinx\\Utils\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Prince Damien Dorcis-Akpaglo", + "email": "princedorcis@gmail.com", + "homepage": "https://github.com/Prinx", + "role": "Developer" + } + ], + "description": "PHP Utilities classes", + "homepage": "https://github.com/Prinx/phputils", + "keywords": [ + "php", + "utils" + ], + "support": { + "issues": "https://github.com/prinx/phputils/issues", + "source": "https://github.com/prinx/phputils/tree/v0.0.3" + }, + "time": "2020-10-22T14:42:29+00:00" + }, + { + "name": "prinx/string-utils", + "version": "v0.0.2", + "source": { + "type": "git", + "url": "https://github.com/prinx/php-string-utils.git", + "reference": "475b6a11b709aa0284e2e4f7af7e3a354a725537" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/prinx/php-string-utils/zipball/475b6a11b709aa0284e2e4f7af7e3a354a725537", + "reference": "475b6a11b709aa0284e2e4f7af7e3a354a725537", + "shasum": "" + }, + "require-dev": { + "phpunit/phpunit": "9.2.5" + }, + "type": "library", + "autoload": { + "psr-4": { + "Prinx\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Prince Dorcis", + "email": "princedorcis@gmail.com" + } + ], + "description": "PHP string utility methods", + "support": { + "issues": "https://github.com/prinx/php-string-utils/issues", + "source": "https://github.com/prinx/php-string-utils/tree/v0.0.2" + }, + "time": "2020-10-22T11:43:25+00:00" + }, + { + "name": "psr/container", + "version": "1.1.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "8622567409010282b7aeebe4bb841fe98b58dcaf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/8622567409010282b7aeebe4bb841fe98b58dcaf", + "reference": "8622567409010282b7aeebe4bb841fe98b58dcaf", + "shasum": "" + }, + "require": { + "php": ">=7.2.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "support": { + "issues": "https://github.com/php-fig/container/issues", + "source": "https://github.com/php-fig/container/tree/1.1.1" + }, + "time": "2021-03-05T17:36:06+00:00" + }, + { + "name": "psr/simple-cache", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/simple-cache.git", + "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", + "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\SimpleCache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interfaces for simple caching", + "keywords": [ + "cache", + "caching", + "psr", + "psr-16", + "simple-cache" + ], + "support": { + "source": "https://github.com/php-fig/simple-cache/tree/master" + }, + "time": "2017-10-23T01:57:42+00:00" + }, + { + "name": "psy/psysh", + "version": "v0.10.8", + "source": { + "type": "git", + "url": "https://github.com/bobthecow/psysh.git", + "reference": "e4573f47750dd6c92dca5aee543fa77513cbd8d3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/bobthecow/psysh/zipball/e4573f47750dd6c92dca5aee543fa77513cbd8d3", + "reference": "e4573f47750dd6c92dca5aee543fa77513cbd8d3", + "shasum": "" + }, + "require": { + "ext-json": "*", + "ext-tokenizer": "*", + "nikic/php-parser": "~4.0|~3.0|~2.0|~1.3", + "php": "^8.0 || ^7.0 || ^5.5.9", + "symfony/console": "~5.0|~4.0|~3.0|^2.4.2|~2.3.10", + "symfony/var-dumper": "~5.0|~4.0|~3.0|~2.7" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.2", + "hoa/console": "3.17.*" + }, + "suggest": { + "ext-pcntl": "Enabling the PCNTL extension makes PsySH a lot happier :)", + "ext-pdo-sqlite": "The doc command requires SQLite to work.", + "ext-posix": "If you have PCNTL, you'll want the POSIX extension as well.", + "ext-readline": "Enables support for arrow-key history navigation, and showing and manipulating command history.", + "hoa/console": "A pure PHP readline implementation. You'll want this if your PHP install doesn't already support readline or libedit." + }, + "bin": [ + "bin/psysh" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "0.10.x-dev" + } + }, + "autoload": { + "files": [ + "src/functions.php" + ], + "psr-4": { + "Psy\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Justin Hileman", + "email": "justin@justinhileman.info", + "homepage": "http://justinhileman.com" + } + ], + "description": "An interactive shell for modern PHP.", + "homepage": "http://psysh.org", + "keywords": [ + "REPL", + "console", + "interactive", + "shell" + ], + "support": { + "issues": "https://github.com/bobthecow/psysh/issues", + "source": "https://github.com/bobthecow/psysh/tree/v0.10.8" + }, + "time": "2021-04-10T16:23:39+00:00" + }, + { + "name": "symfony/console", + "version": "v5.2.6", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "35f039df40a3b335ebf310f244cb242b3a83ac8d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/35f039df40a3b335ebf310f244cb242b3a83ac8d", + "reference": "35f039df40a3b335ebf310f244cb242b3a83ac8d", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php73": "^1.8", + "symfony/polyfill-php80": "^1.15", + "symfony/service-contracts": "^1.1|^2", + "symfony/string": "^5.1" + }, + "conflict": { + "symfony/dependency-injection": "<4.4", + "symfony/dotenv": "<5.1", + "symfony/event-dispatcher": "<4.4", + "symfony/lock": "<4.4", + "symfony/process": "<4.4" + }, + "provide": { + "psr/log-implementation": "1.0" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "^4.4|^5.0", + "symfony/dependency-injection": "^4.4|^5.0", + "symfony/event-dispatcher": "^4.4|^5.0", + "symfony/lock": "^4.4|^5.0", + "symfony/process": "^4.4|^5.0", + "symfony/var-dumper": "^4.4|^5.0" + }, + "suggest": { + "psr/log": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/lock": "", + "symfony/process": "" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Console\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Eases the creation of beautiful and testable command line interfaces", + "homepage": "https://symfony.com", + "keywords": [ + "cli", + "command line", + "console", + "terminal" + ], + "support": { + "source": "https://github.com/symfony/console/tree/v5.2.6" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-03-28T09:42:18+00:00" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.22.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "c6c942b1ac76c82448322025e084cadc56048b4e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/c6c942b1ac76c82448322025e084cadc56048b4e", + "reference": "c6c942b1ac76c82448322025e084cadc56048b4e", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.22-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "support": { + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.22.1" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-01-07T16:49:33+00:00" + }, + { + "name": "symfony/polyfill-intl-grapheme", + "version": "v1.22.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-grapheme.git", + "reference": "5601e09b69f26c1828b13b6bb87cb07cddba3170" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/5601e09b69f26c1828b13b6bb87cb07cddba3170", + "reference": "5601e09b69f26c1828b13b6bb87cb07cddba3170", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.22-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Intl\\Grapheme\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's grapheme_* functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "grapheme", + "intl", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.22.1" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-01-22T09:19:47+00:00" + }, + { + "name": "symfony/polyfill-intl-normalizer", + "version": "v1.22.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-normalizer.git", + "reference": "43a0283138253ed1d48d352ab6d0bdb3f809f248" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/43a0283138253ed1d48d352ab6d0bdb3f809f248", + "reference": "43a0283138253ed1d48d352ab6d0bdb3f809f248", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.22-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Intl\\Normalizer\\": "" + }, + "files": [ + "bootstrap.php" + ], + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's Normalizer class and related functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "intl", + "normalizer", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.22.1" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-01-22T09:19:47+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.22.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "5232de97ee3b75b0360528dae24e73db49566ab1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/5232de97ee3b75b0360528dae24e73db49566ab1", + "reference": "5232de97ee3b75b0360528dae24e73db49566ab1", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.22-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.22.1" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-01-22T09:19:47+00:00" + }, + { + "name": "symfony/polyfill-php73", + "version": "v1.22.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php73.git", + "reference": "a678b42e92f86eca04b7fa4c0f6f19d097fb69e2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/a678b42e92f86eca04b7fa4c0f6f19d097fb69e2", + "reference": "a678b42e92f86eca04b7fa4c0f6f19d097fb69e2", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.22-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Php73\\": "" + }, + "files": [ + "bootstrap.php" + ], + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php73/tree/v1.22.1" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-01-07T16:49:33+00:00" + }, + { + "name": "symfony/polyfill-php80", + "version": "v1.22.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "dc3063ba22c2a1fd2f45ed856374d79114998f91" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/dc3063ba22c2a1fd2f45ed856374d79114998f91", + "reference": "dc3063ba22c2a1fd2f45ed856374d79114998f91", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.22-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, + "files": [ + "bootstrap.php" + ], + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php80/tree/v1.22.1" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-01-07T16:49:33+00:00" + }, + { + "name": "symfony/service-contracts", + "version": "v2.2.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/service-contracts.git", + "reference": "d15da7ba4957ffb8f1747218be9e1a121fd298a1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/d15da7ba4957ffb8f1747218be9e1a121fd298a1", + "reference": "d15da7ba4957ffb8f1747218be9e1a121fd298a1", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "psr/container": "^1.0" + }, + "suggest": { + "symfony/service-implementation": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\Service\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to writing services", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/service-contracts/tree/master" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-09-07T11:33:47+00:00" + }, + { + "name": "symfony/string", + "version": "v5.2.6", + "source": { + "type": "git", + "url": "https://github.com/symfony/string.git", + "reference": "ad0bd91bce2054103f5eaa18ebeba8d3bc2a0572" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/string/zipball/ad0bd91bce2054103f5eaa18ebeba8d3bc2a0572", + "reference": "ad0bd91bce2054103f5eaa18ebeba8d3bc2a0572", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-intl-grapheme": "~1.0", + "symfony/polyfill-intl-normalizer": "~1.0", + "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php80": "~1.15" + }, + "require-dev": { + "symfony/error-handler": "^4.4|^5.0", + "symfony/http-client": "^4.4|^5.0", + "symfony/translation-contracts": "^1.1|^2", + "symfony/var-exporter": "^4.4|^5.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\String\\": "" + }, + "files": [ + "Resources/functions.php" + ], + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way", + "homepage": "https://symfony.com", + "keywords": [ + "grapheme", + "i18n", + "string", + "unicode", + "utf-8", + "utf8" + ], + "support": { + "source": "https://github.com/symfony/string/tree/v5.2.6" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-03-17T17:12:15+00:00" + }, + { + "name": "symfony/translation", + "version": "v5.2.6", + "source": { + "type": "git", + "url": "https://github.com/symfony/translation.git", + "reference": "2cc7f45d96db9adfcf89adf4401d9dfed509f4e1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/translation/zipball/2cc7f45d96db9adfcf89adf4401d9dfed509f4e1", + "reference": "2cc7f45d96db9adfcf89adf4401d9dfed509f4e1", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php80": "^1.15", + "symfony/translation-contracts": "^2.3" + }, + "conflict": { + "symfony/config": "<4.4", + "symfony/dependency-injection": "<5.0", + "symfony/http-kernel": "<5.0", + "symfony/twig-bundle": "<5.0", + "symfony/yaml": "<4.4" + }, + "provide": { + "symfony/translation-implementation": "2.3" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/config": "^4.4|^5.0", + "symfony/console": "^4.4|^5.0", + "symfony/dependency-injection": "^5.0", + "symfony/finder": "^4.4|^5.0", + "symfony/http-kernel": "^5.0", + "symfony/intl": "^4.4|^5.0", + "symfony/service-contracts": "^1.1.2|^2", + "symfony/yaml": "^4.4|^5.0" + }, + "suggest": { + "psr/log-implementation": "To use logging capability in translator", + "symfony/config": "", + "symfony/yaml": "" + }, + "type": "library", + "autoload": { + "files": [ + "Resources/functions.php" + ], + "psr-4": { + "Symfony\\Component\\Translation\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides tools to internationalize your application", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/translation/tree/v5.2.6" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-03-23T19:33:48+00:00" + }, + { + "name": "symfony/translation-contracts", + "version": "v2.3.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/translation-contracts.git", + "reference": "e2eaa60b558f26a4b0354e1bbb25636efaaad105" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/e2eaa60b558f26a4b0354e1bbb25636efaaad105", + "reference": "e2eaa60b558f26a4b0354e1bbb25636efaaad105", + "shasum": "" + }, + "require": { + "php": ">=7.2.5" + }, + "suggest": { + "symfony/translation-implementation": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\Translation\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to translation", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/translation-contracts/tree/v2.3.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-09-28T13:05:58+00:00" + }, + { + "name": "symfony/var-dumper", + "version": "v5.2.6", + "source": { + "type": "git", + "url": "https://github.com/symfony/var-dumper.git", + "reference": "89412a68ea2e675b4e44f260a5666729f77f668e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/89412a68ea2e675b4e44f260a5666729f77f668e", + "reference": "89412a68ea2e675b4e44f260a5666729f77f668e", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php80": "^1.15" + }, + "conflict": { + "phpunit/phpunit": "<5.4.3", + "symfony/console": "<4.4" + }, + "require-dev": { + "ext-iconv": "*", + "symfony/console": "^4.4|^5.0", + "symfony/process": "^4.4|^5.0", + "twig/twig": "^2.13|^3.0.4" + }, + "suggest": { + "ext-iconv": "To convert non-UTF-8 strings to UTF-8 (or symfony/polyfill-iconv in case ext-iconv cannot be used).", + "ext-intl": "To show region name in time zone dump", + "symfony/console": "To use the ServerDumpCommand and/or the bin/var-dump-server script" + }, + "bin": [ + "Resources/bin/var-dump-server" + ], + "type": "library", + "autoload": { + "files": [ + "Resources/functions/dump.php" + ], + "psr-4": { + "Symfony\\Component\\VarDumper\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides mechanisms for walking through any arbitrary PHP variable", + "homepage": "https://symfony.com", + "keywords": [ + "debug", + "dump" + ], + "support": { + "source": "https://github.com/symfony/var-dumper/tree/v5.2.6" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-03-28T09:42:18+00:00" + }, + { + "name": "voku/portable-ascii", + "version": "1.5.6", + "source": { + "type": "git", + "url": "https://github.com/voku/portable-ascii.git", + "reference": "80953678b19901e5165c56752d087fc11526017c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/voku/portable-ascii/zipball/80953678b19901e5165c56752d087fc11526017c", + "reference": "80953678b19901e5165c56752d087fc11526017c", + "shasum": "" + }, + "require": { + "php": ">=7.0.0" + }, + "require-dev": { + "phpunit/phpunit": "~6.0 || ~7.0 || ~9.0" + }, + "suggest": { + "ext-intl": "Use Intl for transliterator_transliterate() support" + }, + "type": "library", + "autoload": { + "psr-4": { + "voku\\": "src/voku/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Lars Moelleken", + "homepage": "http://www.moelleken.org/" + } + ], + "description": "Portable ASCII library - performance optimized (ascii) string functions for php.", + "homepage": "https://github.com/voku/portable-ascii", + "keywords": [ + "ascii", + "clean", + "php" + ], + "support": { + "issues": "https://github.com/voku/portable-ascii/issues", + "source": "https://github.com/voku/portable-ascii/tree/1.5.6" + }, + "funding": [ + { + "url": "https://www.paypal.me/moelleken", + "type": "custom" + }, + { + "url": "https://github.com/voku", + "type": "github" + }, + { + "url": "https://opencollective.com/portable-ascii", + "type": "open_collective" + }, + { + "url": "https://www.patreon.com/voku", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/voku/portable-ascii", + "type": "tidelift" + } + ], + "time": "2020-11-12T00:07:28+00:00" + } + ], + "packages-dev": [ + { + "name": "doctrine/instantiator", + "version": "1.4.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/instantiator.git", + "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/d56bf6102915de5702778fe20f2de3b2fe570b5b", + "reference": "d56bf6102915de5702778fe20f2de3b2fe570b5b", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "doctrine/coding-standard": "^8.0", + "ext-pdo": "*", + "ext-phar": "*", + "phpbench/phpbench": "^0.13 || 1.0.0-alpha2", + "phpstan/phpstan": "^0.12", + "phpstan/phpstan-phpunit": "^0.12", + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" + }, + "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/1.4.0" + }, + "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": "2020-11-10T18:47:58+00:00" + }, + { + "name": "myclabs/deep-copy", + "version": "1.10.2", + "source": { + "type": "git", + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "776f831124e9c62e1a2c601ecc52e776d8bb7220" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/776f831124e9c62e1a2c601ecc52e776d8bb7220", + "reference": "776f831124e9c62e1a2c601ecc52e776d8bb7220", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "replace": { + "myclabs/deep-copy": "self.version" + }, + "require-dev": { + "doctrine/collections": "^1.0", + "doctrine/common": "^2.6", + "phpunit/phpunit": "^7.1" + }, + "type": "library", + "autoload": { + "psr-4": { + "DeepCopy\\": "src/DeepCopy/" + }, + "files": [ + "src/DeepCopy/deep_copy.php" + ] + }, + "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.10.2" + }, + "funding": [ + { + "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", + "type": "tidelift" + } + ], + "time": "2020-11-13T09:40:50+00:00" + }, + { + "name": "phar-io/manifest", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/phar-io/manifest.git", + "reference": "85265efd3af7ba3ca4b2a2c34dbfc5788dd29133" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/85265efd3af7ba3ca4b2a2c34dbfc5788dd29133", + "reference": "85265efd3af7ba3ca4b2a2c34dbfc5788dd29133", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-phar": "*", + "ext-xmlwriter": "*", + "phar-io/version": "^3.0.1", + "php": "^7.2 || ^8.0" + }, + "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/master" + }, + "time": "2020-06-27T14:33:11+00:00" + }, + { + "name": "phar-io/version", + "version": "3.1.0", + "source": { + "type": "git", + "url": "https://github.com/phar-io/version.git", + "reference": "bae7c545bef187884426f042434e561ab1ddb182" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/version/zipball/bae7c545bef187884426f042434e561ab1ddb182", + "reference": "bae7c545bef187884426f042434e561ab1ddb182", + "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.1.0" + }, + "time": "2021-02-23T14:00:09+00:00" + }, + { + "name": "phpdocumentor/reflection-common", + "version": "2.2.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionCommon.git", + "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/1d01c49d4ed62f25aa84a747ad35d5a16924662b", + "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-2.x": "2.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jaap van Otterdijk", + "email": "opensource@ijaap.nl" + } + ], + "description": "Common reflection classes used by phpdocumentor to reflect the code structure", + "homepage": "http://www.phpdoc.org", + "keywords": [ + "FQSEN", + "phpDocumentor", + "phpdoc", + "reflection", + "static analysis" + ], + "support": { + "issues": "https://github.com/phpDocumentor/ReflectionCommon/issues", + "source": "https://github.com/phpDocumentor/ReflectionCommon/tree/2.x" + }, + "time": "2020-06-27T09:03:43+00:00" + }, + { + "name": "phpdocumentor/reflection-docblock", + "version": "5.2.2", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "069a785b2141f5bcf49f3e353548dc1cce6df556" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/069a785b2141f5bcf49f3e353548dc1cce6df556", + "reference": "069a785b2141f5bcf49f3e353548dc1cce6df556", + "shasum": "" + }, + "require": { + "ext-filter": "*", + "php": "^7.2 || ^8.0", + "phpdocumentor/reflection-common": "^2.2", + "phpdocumentor/type-resolver": "^1.3", + "webmozart/assert": "^1.9.1" + }, + "require-dev": { + "mockery/mockery": "~1.3.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + }, + { + "name": "Jaap van Otterdijk", + "email": "account@ijaap.nl" + } + ], + "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", + "support": { + "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", + "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/master" + }, + "time": "2020-09-03T19:13:55+00:00" + }, + { + "name": "phpdocumentor/type-resolver", + "version": "1.4.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/TypeResolver.git", + "reference": "6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0", + "reference": "6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0", + "phpdocumentor/reflection-common": "^2.0" + }, + "require-dev": { + "ext-tokenizer": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-1.x": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", + "support": { + "issues": "https://github.com/phpDocumentor/TypeResolver/issues", + "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.4.0" + }, + "time": "2020-09-17T18:55:26+00:00" + }, + { + "name": "phpspec/prophecy", + "version": "1.13.0", + "source": { + "type": "git", + "url": "https://github.com/phpspec/prophecy.git", + "reference": "be1996ed8adc35c3fd795488a653f4b518be70ea" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/be1996ed8adc35c3fd795488a653f4b518be70ea", + "reference": "be1996ed8adc35c3fd795488a653f4b518be70ea", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.2", + "php": "^7.2 || ~8.0, <8.1", + "phpdocumentor/reflection-docblock": "^5.2", + "sebastian/comparator": "^3.0 || ^4.0", + "sebastian/recursion-context": "^3.0 || ^4.0" + }, + "require-dev": { + "phpspec/phpspec": "^6.0", + "phpunit/phpunit": "^8.0 || ^9.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.11.x-dev" + } + }, + "autoload": { + "psr-4": { + "Prophecy\\": "src/Prophecy" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + }, + { + "name": "Marcello Duarte", + "email": "marcello.duarte@gmail.com" + } + ], + "description": "Highly opinionated mocking framework for PHP 5.3+", + "homepage": "https://github.com/phpspec/prophecy", + "keywords": [ + "Double", + "Dummy", + "fake", + "mock", + "spy", + "stub" + ], + "support": { + "issues": "https://github.com/phpspec/prophecy/issues", + "source": "https://github.com/phpspec/prophecy/tree/1.13.0" + }, + "time": "2021-03-17T13:42:18+00:00" + }, + { + "name": "phpunit/php-code-coverage", + "version": "9.2.6", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "f6293e1b30a2354e8428e004689671b83871edde" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/f6293e1b30a2354e8428e004689671b83871edde", + "reference": "f6293e1b30a2354e8428e004689671b83871edde", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-libxml": "*", + "ext-xmlwriter": "*", + "nikic/php-parser": "^4.10.2", + "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.3" + }, + "suggest": { + "ext-pcov": "*", + "ext-xdebug": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "9.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": "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", + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.6" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-03-28T07:26:59+00:00" + }, + { + "name": "phpunit/php-file-iterator", + "version": "3.0.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "aa4be8575f26070b100fccb67faabb28f21f66f8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/aa4be8575f26070b100fccb67faabb28f21f66f8", + "reference": "aa4be8575f26070b100fccb67faabb28f21f66f8", + "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.5" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:57:25+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.5.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "c73c6737305e779771147af66c96ca6a7ed8a741" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/c73c6737305e779771147af66c96ca6a7ed8a741", + "reference": "c73c6737305e779771147af66c96ca6a7ed8a741", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.3.1", + "ext-dom": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xml": "*", + "ext-xmlwriter": "*", + "myclabs/deep-copy": "^1.10.1", + "phar-io/manifest": "^2.0.1", + "phar-io/version": "^3.0.2", + "php": ">=7.3", + "phpspec/prophecy": "^1.12.1", + "phpunit/php-code-coverage": "^9.2.3", + "phpunit/php-file-iterator": "^3.0.5", + "phpunit/php-invoker": "^3.1.1", + "phpunit/php-text-template": "^2.0.3", + "phpunit/php-timer": "^5.0.2", + "sebastian/cli-parser": "^1.0.1", + "sebastian/code-unit": "^1.0.6", + "sebastian/comparator": "^4.0.5", + "sebastian/diff": "^4.0.3", + "sebastian/environment": "^5.1.3", + "sebastian/exporter": "^4.0.3", + "sebastian/global-state": "^5.0.1", + "sebastian/object-enumerator": "^4.0.3", + "sebastian/resource-operations": "^3.0.3", + "sebastian/type": "^2.3", + "sebastian/version": "^3.0.2" + }, + "require-dev": { + "ext-pdo": "*", + "phpspec/prophecy-phpunit": "^2.0.1" + }, + "suggest": { + "ext-soap": "*", + "ext-xdebug": "*" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "9.5-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ], + "files": [ + "src/Framework/Assert/Functions.php" + ] + }, + "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", + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.4" + }, + "funding": [ + { + "url": "https://phpunit.de/donate.html", + "type": "custom" + }, + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-03-23T07:16:29+00:00" + }, + { + "name": "sebastian/cli-parser", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/cli-parser.git", + "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/442e7c7e687e42adc03470c7b668bc4b2402c0b2", + "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2", + "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.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T06:08:49+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.6", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "55f4261989e546dc112258c7a75935a81a7ce382" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/55f4261989e546dc112258c7a75935a81a7ce382", + "reference": "55f4261989e546dc112258c7a75935a81a7ce382", + "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.6" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T15:49:45+00:00" + }, + { + "name": "sebastian/complexity", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/complexity.git", + "reference": "739b35e53379900cc9ac327b2147867b8b6efd88" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/739b35e53379900cc9ac327b2147867b8b6efd88", + "reference": "739b35e53379900cc9ac327b2147867b8b6efd88", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4.7", + "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.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T15:52:27+00:00" + }, + { + "name": "sebastian/diff", + "version": "4.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/3461e3fccc7cfdfc2720be910d3bd73c69be590d", + "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d", + "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.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:10:38+00:00" + }, + { + "name": "sebastian/environment", + "version": "5.1.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "388b6ced16caa751030f6a69e588299fa09200ac" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/388b6ced16caa751030f6a69e588299fa09200ac", + "reference": "388b6ced16caa751030f6a69e588299fa09200ac", + "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.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:52:38+00:00" + }, + { + "name": "sebastian/exporter", + "version": "4.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "d89cc98761b8cb5a1a235a6b703ae50d34080e65" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/d89cc98761b8cb5a1a235a6b703ae50d34080e65", + "reference": "d89cc98761b8cb5a1a235a6b703ae50d34080e65", + "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": "http://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.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:24:23+00:00" + }, + { + "name": "sebastian/global-state", + "version": "5.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "a90ccbddffa067b51f574dea6eb25d5680839455" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/a90ccbddffa067b51f574dea6eb25d5680839455", + "reference": "a90ccbddffa067b51f574dea6eb25d5680839455", + "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.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T15:55:19+00:00" + }, + { + "name": "sebastian/lines-of-code", + "version": "1.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/lines-of-code.git", + "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/c1c2e997aa3146983ed888ad08b15470a2e22ecc", + "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4.6", + "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.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-11-28T06:42:11+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.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "cd9d8cf3c5804de4341c283ed787f099f5506172" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/cd9d8cf3c5804de4341c283ed787f099f5506172", + "reference": "cd9d8cf3c5804de4341c283ed787f099f5506172", + "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": "http://www.github.com/sebastianbergmann/recursion-context", + "support": { + "issues": "https://github.com/sebastianbergmann/recursion-context/issues", + "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:17:30+00:00" + }, + { + "name": "sebastian/resource-operations", + "version": "3.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/resource-operations.git", + "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", + "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.0" + }, + "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" + } + ], + "description": "Provides a list of PHP built-in functions that operate on resources", + "homepage": "https://www.github.com/sebastianbergmann/resource-operations", + "support": { + "issues": "https://github.com/sebastianbergmann/resource-operations/issues", + "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T06:45:17+00:00" + }, + { + "name": "sebastian/type", + "version": "2.3.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/type.git", + "reference": "81cd61ab7bbf2de744aba0ea61fae32f721df3d2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/81cd61ab7bbf2de744aba0ea61fae32f721df3d2", + "reference": "81cd61ab7bbf2de744aba0ea61fae32f721df3d2", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3-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/2.3.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:18:59+00:00" + }, + { + "name": "sebastian/version", + "version": "3.0.2", + "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": "theseer/tokenizer", + "version": "1.2.0", + "source": { + "type": "git", + "url": "https://github.com/theseer/tokenizer.git", + "reference": "75a63c33a8577608444246075ea0af0d052e452a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/75a63c33a8577608444246075ea0af0d052e452a", + "reference": "75a63c33a8577608444246075ea0af0d052e452a", + "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/master" + }, + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } + ], + "time": "2020-07-12T23:59:07+00:00" + }, + { + "name": "webmozart/assert", + "version": "1.10.0", + "source": { + "type": "git", + "url": "https://github.com/webmozarts/assert.git", + "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozarts/assert/zipball/6964c76c7804814a842473e0c8fd15bab0f18e25", + "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0", + "symfony/polyfill-ctype": "^1.8" + }, + "conflict": { + "phpstan/phpstan": "<0.12.20", + "vimeo/psalm": "<4.6.1 || 4.6.2" + }, + "require-dev": { + "phpunit/phpunit": "^8.5.13" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.10-dev" + } + }, + "autoload": { + "psr-4": { + "Webmozart\\Assert\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Assertions to validate method input/output with nice error messages.", + "keywords": [ + "assert", + "check", + "validate" + ], + "support": { + "issues": "https://github.com/webmozarts/assert/issues", + "source": "https://github.com/webmozarts/assert/tree/1.10.0" + }, + "time": "2021-03-09T10:59:23+00:00" + } + ], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": true, + "prefer-lowest": false, + "platform": { + "php": ">=7.3" + }, + "platform-dev": [], + "plugin-api-version": "2.0.0" +} diff --git a/src/Menu/BaseMenu.php b/src/Menu/BaseMenu.php index 59faa51..6d3c646 100644 --- a/src/Menu/BaseMenu.php +++ b/src/Menu/BaseMenu.php @@ -268,6 +268,7 @@ public function userResponse() /** * Get the raw response of the user for this menu. + * Alias for `userResponse`. * * @return string */ @@ -389,16 +390,32 @@ public function db($name = '') return $this->app->db($name); } + /** + * If the user has just resumed from the previous session (if the current menu is where the + * user left on the previous session). + * + * @return boolean + */ public function hasResumedFromPreviousSessionOnThisMenu() { - return $this->hasResumedFromPreviousSessionOnThisMenu(); + return $this->app->hasResumedFromPreviousSessionOnThisMenu(); } + /** + * Alias for `hasResumedFromLasSessionOnThisMenu`. + * + * @return boolean + */ public function hasJustResumedFromPreviousSession() { - return $this->app->hasResumedFromPreviousSessionOnThisMenu(); + return $this->hasResumedFromPreviousSessionOnThisMenu(); } + /** + * If the current menu flow started with the user choosing "Start from previous session" + * + * @return boolean + */ public function hasResumedFromPreviousSession() { return $this->app->hasResumedFromPreviousSession(); diff --git a/src/Session/DatabaseSession.php b/src/Session/DatabaseSession.php index 53fe824..4b9e317 100644 --- a/src/Session/DatabaseSession.php +++ b/src/Session/DatabaseSession.php @@ -21,7 +21,7 @@ * * @author Prince Dorcis */ -class DatabaseSession extends Session implements SessionInterface +class DatabaseSession extends Session { protected $db; protected $tableName; diff --git a/src/Session/FileSession.php b/src/Session/FileSession.php index bd12ed2..632d2a3 100644 --- a/src/Session/FileSession.php +++ b/src/Session/FileSession.php @@ -20,7 +20,7 @@ * * @author Prince Dorcis */ -class FileSession extends Session implements SessionInterface +class FileSession extends Session { protected $file = null; diff --git a/src/Session/Session.php b/src/Session/Session.php index ae992cb..bd6e69e 100644 --- a/src/Session/Session.php +++ b/src/Session/Session.php @@ -21,7 +21,7 @@ * * @author Prince Dorcis */ -class Session +abstract class Session implements SessionInterface { protected $driver; protected $app; @@ -40,26 +40,6 @@ public function __construct(Kernel $app) $this->driver = $this->config['driver']; } - /** - * Check if the just retrieved session is a previous session. - * - * @return bool - */ - public function isPrevious() - { - return !$this->isNew(); - } - - /** - * Check if the session loaded is a new session. - * - * @return bool - */ - public function isNew() - { - return $this->isNew; - } - /** * Starts the session. * @@ -75,25 +55,16 @@ protected function start() } elseif ($this->app->isFirstRequest() && $this->hasExpired()) { $this->renew(); } - - // switch ($this->app->ussdRequestType()) { - // case APP_REQUEST_INIT: - // if ($this->hasExpired()) { - // $this->renew(); - // } - - // break; - - // case APP_REQUEST_USER_SENT_RESPONSE: - // break; - // } } - public function renew() + /** + * Check if the session loaded is a new session. + * + * @return bool + */ + public function isNew() { - $this->deletePreviousData(); - $this->isNew = true; - $this->initialise(); + return $this->isNew; } public function initialise() @@ -112,11 +83,6 @@ public function hasExpired() return $this->hasPassed('lifetime'); } - public function hasTimedOut() - { - return $this->hasPassed('timeout'); - } - public function hasPassed($type) { $allowed = $this->app->config("session.{$type}"); @@ -126,9 +92,11 @@ public function hasPassed($type) return ($now - $lastConnection) >= $allowed; } - public function mustNotTimeout() + public function renew() { - return $this->app->config('app.allow_timeout') === false; + $this->deletePreviousData(); + $this->isNew = true; + $this->initialise(); } protected function deletePreviousData() @@ -137,41 +105,37 @@ protected function deletePreviousData() } /** - * Delete session data from the storage. - * - * This methodm leaves untouched the current live session data + * Check if the just retrieved session is a previous session. * - * @return void + * @return bool */ - public function delete() + public function isPrevious() { + return !$this->isNew(); } - /** - * Attempts to retrieve a previous session data from the storage. - * - * @return void - */ - public function retrievePreviousData() + public function hasTimedOut() { + return $this->hasPassed('timeout'); } - /** - * Save the session data to the current configured storage. - * - * @return void - */ - public function save() + public function mustNotTimeout() { + return $this->app->config('app.allow_timeout') === false; } /** - * Reset completely the session data, both in live and in the storage. + * Reset the session. + * + * This does not affect the session in its storage. Only the live session + * currently in use. To delete the session completely, in live and in the + * storage, use `hardReset` * * @return void */ - public function hardReset() + public function reset() { + $this->initialise(); } /** @@ -249,12 +213,6 @@ public function set(string $key, $value) */ public function remove($key) { - // if (isset($this->data[DEVELOPER_SAVED_DATA][$key])) { - // unset($this->data[DEVELOPER_SAVED_DATA][$key]); - - // return true; - // } - $explodedKey = explode('.', $key); if (isset($this->data[DEVELOPER_SAVED_DATA][$explodedKey[0]])) { @@ -363,18 +321,4 @@ public function metadata(string $key = '', $default = null) return $value; } - - /** - * Reset the session. - * - * This does not affect the session in its storage. Only the live session - * currently in use. To delete the session completely, in live and in the - * storage, use `hardReset` - * - * @return void - */ - public function reset() - { - $this->initialise(); - } } diff --git a/src/Session/SessionInterface.php b/src/Session/SessionInterface.php index 07eca62..97b4f79 100644 --- a/src/Session/SessionInterface.php +++ b/src/Session/SessionInterface.php @@ -20,17 +20,39 @@ interface SessionInterface { public function isPrevious(); + /** + * Delete session data only from the storage. + * + * Does not delete the current live session data. + * + * @return void + */ public function delete(); public function reset(); + /** + * Reset completely the session data, both in live and in the storage. + * + * @return void + */ public function hardReset(); - + + /** + * Attempts to retrieve a previous session data from the storage. + * + * @return void + */ public function retrievePreviousData(); public function retrieveData(); public function previousSessionNotExists(); + /** + * Save the session data to the current configured storage. + * + * @return void + */ public function save(); } From 4faf2dfc00603ebf2abd4b9275ead851f4d35bcd Mon Sep 17 00:00:00 2001 From: Prince Dorcis Date: Fri, 16 Apr 2021 16:54:16 +0000 Subject: [PATCH 07/45] Add clear cache command --- src/Console/Commands/ClearCacheCommand.php | 43 ++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 src/Console/Commands/ClearCacheCommand.php diff --git a/src/Console/Commands/ClearCacheCommand.php b/src/Console/Commands/ClearCacheCommand.php new file mode 100644 index 0000000..39d938b --- /dev/null +++ b/src/Console/Commands/ClearCacheCommand.php @@ -0,0 +1,43 @@ +setName('cache:clear') + ->setDescription('Clear the cache files.'); + } + + public function fire() + { + $finder = new Finder(); + + $finder->files()->ignoreDotFiles(false)->in(storage_path('cache')); + + try { + foreach ($finder as $file) { + if (in_array($file->getFileName(), $this->defaultCacheFiles)) { + file_put_contents($file->getPathname(), ''); + } else { + unlink($file->getPathname()); + } + } + } catch (\Throwable $th) { + $this->error('Error!'); + $this->write($th->getMessage().' in '.$th->getFile().' at line '.$th->getLine()); + + return Smile::FAILURE; + } + + $this->info('Cache cleared successfully!'); + + return Smile::SUCCESS; + } +} From 0ef737f5d6715a17ee1af51ed484d6ac97e7432b Mon Sep 17 00:00:00 2001 From: Prince Dorcis Date: Fri, 16 Apr 2021 16:59:22 +0000 Subject: [PATCH 08/45] Add clear log command --- composer.json | 5 ++-- composer.lock | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 65 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 131dec8..0815c91 100644 --- a/composer.json +++ b/composer.json @@ -28,7 +28,8 @@ "prinx/array-utils": "^0.0", "prinx/os-utils": "^0.0", "psy/psysh": "^0.10", - "illuminate/database": "^8.11" + "illuminate/database": "^8.11", + "symfony/finder": "^5.2" }, "require-dev": { "phpunit/phpunit": "^9.2" @@ -44,4 +45,4 @@ "Rejoice\\": "src/" } } -} \ No newline at end of file +} diff --git a/composer.lock b/composer.lock index 540c5a2..a1792af 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": "ae6d0ee97623e98a3df7999a2520d887", + "content-hash": "8009108d757c959bb772cd0ca05aeb4e", "packages": [ { "name": "doctrine/inflector", @@ -1172,6 +1172,67 @@ ], "time": "2021-03-28T09:42:18+00:00" }, + { + "name": "symfony/finder", + "version": "v5.2.4", + "source": { + "type": "git", + "url": "https://github.com/symfony/finder.git", + "reference": "0d639a0943822626290d169965804f79400e6a04" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/finder/zipball/0d639a0943822626290d169965804f79400e6a04", + "reference": "0d639a0943822626290d169965804f79400e6a04", + "shasum": "" + }, + "require": { + "php": ">=7.2.5" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Finder\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Finds files and directories via an intuitive fluent interface", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/finder/tree/v5.2.4" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2021-02-15T18:55:04+00:00" + }, { "name": "symfony/polyfill-ctype", "version": "v1.22.1", From 458c9fe6d4ec5d246c8a1558141797eebdb4b319 Mon Sep 17 00:00:00 2001 From: Prince Dorcis Date: Fri, 16 Apr 2021 17:01:03 +0000 Subject: [PATCH 09/45] Add clear log and session command --- src/Console/Commands/ClearLogCommand.php | 110 +++++++++++++++++++ src/Console/Commands/ClearSessionCommand.php | 35 ++++++ 2 files changed, 145 insertions(+) create mode 100644 src/Console/Commands/ClearLogCommand.php create mode 100644 src/Console/Commands/ClearSessionCommand.php diff --git a/src/Console/Commands/ClearLogCommand.php b/src/Console/Commands/ClearLogCommand.php new file mode 100644 index 0000000..5f954c9 --- /dev/null +++ b/src/Console/Commands/ClearLogCommand.php @@ -0,0 +1,110 @@ +setName('log:clear') + ->setDescription('Clear log files.') + ->addOption( + 'all', 'a', Option::OPTIONAL, + 'Remove both log files created by rejoice and custom log files.', + true + ) + ->addOption( + 'file', 'f', Option::OPTIONAL, + 'Remove only files.', + false + ) + ->addOption( + 'dir', 'd', Option::OPTIONAL, + 'Remove only directories.', + false + ); + } + + public function fire() + { + $finder = (new Finder())->ignoreDotFiles(false)->sortByType(); + + if (!$this->getOption('all')) { + $finder->name($this->defaultLogs()); + } + + if ($this->getOption('file')) { + $finder->files(); + } elseif ($this->getOption('dir')) { + $finder->directories(); + } + + $path = storage_path('logs'); + + $finder->in($path); + + $files = array_reverse(iterator_to_array($finder)); + + try { + $this->deleteIn($path, $files); + + foreach ($this->defaultLogDirs as $dirname) { + $dir = storage_path('logs/'.$dirname); + + if (!is_dir($dir)) { + mkdir($dir); + } + } + + foreach ($this->defaultLogFiles as $filename) { + $file = storage_path('logs/'.$filename); + + if (!file_exists($file)) { + file_put_contents($file, ''); + } + } + } catch (\Throwable $th) { + $this->error('Error!'); + $this->write($th->getMessage().' in '.$th->getFile().' at line '.$th->getLine()); + + return Smile::FAILURE; + } + + $this->info('Logs cleared successfully!'); + + return Smile::SUCCESS; + } + + public function defaultLogs() + { + return array_merge($this->defaultLogFiles, $this->defaultLogDirs); + } + + public function deleteIn($path, $files = null) + { + $files = $files ?: array_reverse(iterator_to_array((new Finder()) + ->ignoreDotFiles(false) + ->sortByType() + ->in($path))); + + foreach ($files as $file) { + if ($file->isFile() && file_exists($file->getPathname())) { + unlink($file->getPathname()); + continue; + } + + $this->deleteIn($file->getPathname()); + + if (file_exists($file->getPathname())) { + rmdir($file->getPathname()); + } + } + } +} diff --git a/src/Console/Commands/ClearSessionCommand.php b/src/Console/Commands/ClearSessionCommand.php new file mode 100644 index 0000000..cb92de8 --- /dev/null +++ b/src/Console/Commands/ClearSessionCommand.php @@ -0,0 +1,35 @@ +setName('session:clear') + ->setDescription('Clear the sessions.'); + } + + public function fire() + { + try { + $finder = (new Finder())->files()->in(storage_path('sessions')); + + foreach ($finder as $file) { + unlink($file->getPathname()); + } + } catch (\Throwable $th) { + $this->error('Error!'); + $this->write($th->getMessage().' in '.$th->getFile().' at line '.$th->getLine()); + + return Smile::FAILURE; + } + + $this->info('Session cleared successfully!'); + + return Smile::SUCCESS; + } +} From fa57ca40c79912a865739b38387d10dfa265ebb8 Mon Sep 17 00:00:00 2001 From: Prince Dorcis Date: Fri, 16 Apr 2021 17:02:37 +0000 Subject: [PATCH 10/45] Add run PHPUnit test command --- src/Console/Commands/RunTestCommand.php | 46 +++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 src/Console/Commands/RunTestCommand.php diff --git a/src/Console/Commands/RunTestCommand.php b/src/Console/Commands/RunTestCommand.php new file mode 100644 index 0000000..b13e4a7 --- /dev/null +++ b/src/Console/Commands/RunTestCommand.php @@ -0,0 +1,46 @@ +setName('test') + ->setDescription('Run all the tests for the application.'); + } + + public function fire() + { + passthru(PHP_BINARY.' '.Path::toProject('vendor/phpunit/phpunit/phpunit')); + + // $process = (new Process([ + // PHP_BINARY, + // Path::toProject('vendor/phpunit/phpunit/phpunit'), + // '--printer', + // 'NunoMaduro\Collision\Adapters\Phpunit\Printer', + // '-c', + // Path::toProject('phpunit.xml') + // ]))->setTimeout(null); + + // try { + // return $process->run(function ($type, $line) { + // $this->write($line); + // }); + // } catch (ProcessSignaledException $e) { + // if (extension_loaded('pcntl') && $e->getSignal() !== SIGINT) { + // throw $e; + // } + // } + + return Smile::SUCCESS; + } +} From 3a824cc7242b63538fb5040ee4a447fff597de52 Mon Sep 17 00:00:00 2001 From: Prince Dorcis Date: Fri, 16 Apr 2021 17:10:05 +0000 Subject: [PATCH 11/45] Add nunomaduro/collision for beautiful tests --- composer.json | 3 +- composer.lock | 264 +++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 265 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 0815c91..8f2d450 100644 --- a/composer.json +++ b/composer.json @@ -32,7 +32,8 @@ "symfony/finder": "^5.2" }, "require-dev": { - "phpunit/phpunit": "^9.2" + "phpunit/phpunit": "^9.2", + "nunomaduro/collision": "^5.4" }, "config": { "optimize-autoloader": true diff --git a/composer.lock b/composer.lock index a1792af..082437f 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": "8009108d757c959bb772cd0ca05aeb4e", + "content-hash": "2fa6917dafa3b6f1df9c79e6a07550b9", "packages": [ { "name": "doctrine/inflector", @@ -2285,6 +2285,130 @@ ], "time": "2020-11-10T18:47:58+00:00" }, + { + "name": "facade/ignition-contracts", + "version": "1.0.2", + "source": { + "type": "git", + "url": "https://github.com/facade/ignition-contracts.git", + "reference": "3c921a1cdba35b68a7f0ccffc6dffc1995b18267" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/facade/ignition-contracts/zipball/3c921a1cdba35b68a7f0ccffc6dffc1995b18267", + "reference": "3c921a1cdba35b68a7f0ccffc6dffc1995b18267", + "shasum": "" + }, + "require": { + "php": "^7.3|^8.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^v2.15.8", + "phpunit/phpunit": "^9.3.11", + "vimeo/psalm": "^3.17.1" + }, + "type": "library", + "autoload": { + "psr-4": { + "Facade\\IgnitionContracts\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Freek Van der Herten", + "email": "freek@spatie.be", + "homepage": "https://flareapp.io", + "role": "Developer" + } + ], + "description": "Solution contracts for Ignition", + "homepage": "https://github.com/facade/ignition-contracts", + "keywords": [ + "contracts", + "flare", + "ignition" + ], + "support": { + "issues": "https://github.com/facade/ignition-contracts/issues", + "source": "https://github.com/facade/ignition-contracts/tree/1.0.2" + }, + "time": "2020-10-16T08:27:54+00:00" + }, + { + "name": "filp/whoops", + "version": "2.12.0", + "source": { + "type": "git", + "url": "https://github.com/filp/whoops.git", + "reference": "d501fd2658d55491a2295ff600ae5978eaad7403" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/filp/whoops/zipball/d501fd2658d55491a2295ff600ae5978eaad7403", + "reference": "d501fd2658d55491a2295ff600ae5978eaad7403", + "shasum": "" + }, + "require": { + "php": "^5.5.9 || ^7.0 || ^8.0", + "psr/log": "^1.0.1" + }, + "require-dev": { + "mockery/mockery": "^0.9 || ^1.0", + "phpunit/phpunit": "^4.8.36 || ^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.8 || ^9.3.3", + "symfony/var-dumper": "^2.6 || ^3.0 || ^4.0 || ^5.0" + }, + "suggest": { + "symfony/var-dumper": "Pretty print complex values better with var-dumper available", + "whoops/soap": "Formats errors as SOAP responses" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.7-dev" + } + }, + "autoload": { + "psr-4": { + "Whoops\\": "src/Whoops/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Filipe Dobreira", + "homepage": "https://github.com/filp", + "role": "Developer" + } + ], + "description": "php error handling for cool kids", + "homepage": "https://filp.github.io/whoops/", + "keywords": [ + "error", + "exception", + "handling", + "library", + "throwable", + "whoops" + ], + "support": { + "issues": "https://github.com/filp/whoops/issues", + "source": "https://github.com/filp/whoops/tree/2.12.0" + }, + "funding": [ + { + "url": "https://github.com/denis-sokolov", + "type": "github" + } + ], + "time": "2021-03-30T12:00:00+00:00" + }, { "name": "myclabs/deep-copy", "version": "1.10.2", @@ -2343,6 +2467,94 @@ ], "time": "2020-11-13T09:40:50+00:00" }, + { + "name": "nunomaduro/collision", + "version": "v5.4.0", + "source": { + "type": "git", + "url": "https://github.com/nunomaduro/collision.git", + "reference": "41b7e9999133d5082700d31a1d0977161df8322a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nunomaduro/collision/zipball/41b7e9999133d5082700d31a1d0977161df8322a", + "reference": "41b7e9999133d5082700d31a1d0977161df8322a", + "shasum": "" + }, + "require": { + "facade/ignition-contracts": "^1.0", + "filp/whoops": "^2.7.2", + "php": "^7.3 || ^8.0", + "symfony/console": "^5.0" + }, + "require-dev": { + "brianium/paratest": "^6.1", + "fideloper/proxy": "^4.4.1", + "friendsofphp/php-cs-fixer": "^2.17.3", + "fruitcake/laravel-cors": "^2.0.3", + "laravel/framework": "^9.0", + "nunomaduro/larastan": "^0.6.2", + "nunomaduro/mock-final-classes": "^1.0", + "orchestra/testbench": "^7.0", + "phpstan/phpstan": "^0.12.64", + "phpunit/phpunit": "^9.5.0" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "NunoMaduro\\Collision\\Adapters\\Laravel\\CollisionServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "NunoMaduro\\Collision\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nuno Maduro", + "email": "enunomaduro@gmail.com" + } + ], + "description": "Cli error handling for console/command-line PHP applications.", + "keywords": [ + "artisan", + "cli", + "command-line", + "console", + "error", + "handling", + "laravel", + "laravel-zero", + "php", + "symfony" + ], + "support": { + "issues": "https://github.com/nunomaduro/collision/issues", + "source": "https://github.com/nunomaduro/collision" + }, + "funding": [ + { + "url": "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=66BYDWAT92N6L", + "type": "custom" + }, + { + "url": "https://github.com/nunomaduro", + "type": "github" + }, + { + "url": "https://www.patreon.com/nunomaduro", + "type": "patreon" + } + ], + "time": "2021-04-09T13:38:32+00:00" + }, { "name": "phar-io/manifest", "version": "2.0.1", @@ -3100,6 +3312,56 @@ ], "time": "2021-03-23T07:16:29+00:00" }, + { + "name": "psr/log", + "version": "1.1.3", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/0f73288fd15629204f9d42b7055f72dacbe811fc", + "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "Psr/Log/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "support": { + "source": "https://github.com/php-fig/log/tree/1.1.3" + }, + "time": "2020-03-23T09:12:05+00:00" + }, { "name": "sebastian/cli-parser", "version": "1.0.1", From 301d0186b1de7384e235bc55ba54cd90680608fd Mon Sep 17 00:00:00 2001 From: Prince Dorcis Date: Fri, 16 Apr 2021 17:43:07 +0000 Subject: [PATCH 12/45] Add sessionRemember --- src/Foundation/Kernel.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/Foundation/Kernel.php b/src/Foundation/Kernel.php index 90edb16..16a48ca 100644 --- a/src/Foundation/Kernel.php +++ b/src/Foundation/Kernel.php @@ -1501,6 +1501,24 @@ public function sessionRemove($key) return $this->session->remove($key); } + /** + * Returns the session value of `$key` if `$key` is in the session, else returns `$default` and + * save `$default` to the session. + * + * @param string $key + * @param mixed $default + * + * @return mixed + */ + public function sessionRemember($key, $default) + { + if (!$this->sessionHas($key)) { + $this->sessionSave($key, $default); + } + + return $this->session($key); + } + /** * Allows the developer to retrieve a value from the session. * This is identical to `sessionGet` From c45c91babc33e3cc55584b8ab20bfa863468641d Mon Sep 17 00:00:00 2001 From: Prince Dorcis Date: Fri, 16 Apr 2021 17:50:44 +0000 Subject: [PATCH 13/45] Add support for closure in sessionSave --- src/Foundation/Kernel.php | 2 +- src/Session/Session.php | 19 +++++++------------ 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/src/Foundation/Kernel.php b/src/Foundation/Kernel.php index 16a48ca..03a5dfc 100644 --- a/src/Foundation/Kernel.php +++ b/src/Foundation/Kernel.php @@ -1502,7 +1502,7 @@ public function sessionRemove($key) } /** - * Returns the session value of `$key` if `$key` is in the session, else returns `$default` and + * Returns the session value of `$key` if `$key` is in the session, else returns `$default` and * save `$default` to the session. * * @param string $key diff --git a/src/Session/Session.php b/src/Session/Session.php index bd6e69e..81a4eba 100644 --- a/src/Session/Session.php +++ b/src/Session/Session.php @@ -182,8 +182,7 @@ public function get($key = null, $default = null) /** * Set a value into the part of the session accessible by the developer. * - * @param string $key - * @param mixed $value + * @param mixed $value * * @return void */ @@ -193,6 +192,10 @@ public function set(string $key, $value) $this->setMetadata(DEVELOPER_SAVED_DATA, []); } + if (is_callable($value)) { + $value = call_user_func($value); + } + $this->data[DEVELOPER_SAVED_DATA] = Arr::multiKeySet( $key, $value, @@ -233,8 +236,6 @@ public function remove($key) * * If no key is passed, checks if the session is not empty * - * @param string $key - * * @return bool */ public function has(string $key = '') @@ -251,8 +252,6 @@ public function has(string $key = '') * * If no key is passed, checks if the session is not empty * - * @param string $key - * * @return bool */ public function hasMetadata(string $key = '') @@ -267,8 +266,7 @@ public function hasMetadata(string $key = '') /** * Set a framework-level variable in the session. * - * @param string $key - * @param mixed $value + * @param mixed $value * * @return void */ @@ -284,8 +282,6 @@ public function setMetadata(string $key, $value) * * Returns true if the variable exists and has been removed, false otherwise * - * @param string $key - * * @return void */ public function removeMetadata(string $key) @@ -296,8 +292,7 @@ public function removeMetadata(string $key) /** * Retrieve a framework-level variable from the session. * - * @param string $key - * @param mixed $default + * @param mixed $default * * @throws \RuntimeException If value not found and no default value has been provided * From d7438a81ea7becdf8349e209d6522a20a6d51bed Mon Sep 17 00:00:00 2001 From: Prince Dorcis Date: Fri, 16 Apr 2021 21:54:01 +0000 Subject: [PATCH 14/45] Fix session remember --- config/rejoice.php | 50 ++++++++++++++++---------------- src/Foundation/Kernel.php | 6 +--- src/Foundation/Path.php | 7 ++++- src/Menu/Traits/Session.php | 29 +++++++++++++----- src/Session/Session.php | 18 ++++++++++++ src/Session/SessionInterface.php | 45 +++++++++++++++++++++++++++- 6 files changed, 116 insertions(+), 39 deletions(-) diff --git a/config/rejoice.php b/config/rejoice.php index 7a76340..7dee8da 100644 --- a/config/rejoice.php +++ b/config/rejoice.php @@ -2,37 +2,37 @@ use Rejoice\Foundation\Path; -$projectRoot = Path::toProject(); +dump($projectRoot = Path::toProject()); $frameworkRoot = Path::toFramework(); return [ 'paths' => [ - 'project_root' => $projectRoot, - 'default_env_file' => $projectRoot.'.env', - 'app_root_dir' => $projectRoot.'app/', - 'app_menu_class_dir' => $projectRoot.'app/Menus/', - 'app_model_dir' => $projectRoot.'app/Models/', - 'app_config_dir' => $projectRoot.'config/', - 'app_config_file' => $projectRoot.'config/app.php', - 'app_database_config_file' => $projectRoot.'config/database.php', - 'app_session_config_file' => $projectRoot.'config/session.php', - 'public_root_dir' => $projectRoot.'public/', - 'resource_root_dir' => $projectRoot.'resources/', - 'menu_resource_dir' => $projectRoot.'resources/menus/', - 'storage_root_dir' => $projectRoot.'storage/', - 'cache_root_dir' => $projectRoot.'storage/cache/', - 'app_default_cache_file' => $projectRoot.'storage/cache/rejoice.cache', + 'project_root' => $projectRoot, + 'default_env_file' => $projectRoot.'.env', + 'app_root_dir' => $projectRoot.'app/', + 'app_menu_class_dir' => $projectRoot.'app/Menus/', + 'app_model_dir' => $projectRoot.'app/Models/', + 'app_config_dir' => $projectRoot.'config/', + 'app_config_file' => $projectRoot.'config/app.php', + 'app_database_config_file' => $projectRoot.'config/database.php', + 'app_session_config_file' => $projectRoot.'config/session.php', + 'public_root_dir' => $projectRoot.'public/', + 'resource_root_dir' => $projectRoot.'resources/', + 'menu_resource_dir' => $projectRoot.'resources/menus/', + 'storage_root_dir' => $projectRoot.'storage/', + 'cache_root_dir' => $projectRoot.'storage/cache/', + 'app_default_cache_file' => $projectRoot.'storage/cache/rejoice.cache', 'app_default_log_count_file' => $projectRoot.'storage/cache/.log-count.cache', - 'log_root_dir' => $projectRoot.'storage/logs/', - 'app_default_log_file' => $projectRoot.'storage/logs/rejoice.log', - 'session_root_dir' => $projectRoot.'storage/sessions/', - 'test_root_dir' => $projectRoot.'tests/', - 'app_command_dir' => $projectRoot.'app/Console/Commands/', - 'app_command_file' => $projectRoot.'app/Console/commands.php', + 'log_root_dir' => $projectRoot.'storage/logs/', + 'app_default_log_file' => $projectRoot.'storage/logs/rejoice.log', + 'session_root_dir' => $projectRoot.'storage/sessions/', + 'test_root_dir' => $projectRoot.'tests/', + 'app_command_dir' => $projectRoot.'app/Console/Commands/', + 'app_command_file' => $projectRoot.'app/Console/commands.php', - 'framework_root' => $frameworkRoot, - 'framework_command_dir' => $frameworkRoot.'src/Console/Commands/', + 'framework_root' => $frameworkRoot, + 'framework_command_dir' => $frameworkRoot.'src/Console/Commands/', 'framework_command_file' => $frameworkRoot.'src/Console/commands.php', - 'framework_stub_dir' => $frameworkRoot.'src/Stubs/', + 'framework_stub_dir' => $frameworkRoot.'src/Stubs/', ], ]; diff --git a/src/Foundation/Kernel.php b/src/Foundation/Kernel.php index 03a5dfc..86f4e66 100644 --- a/src/Foundation/Kernel.php +++ b/src/Foundation/Kernel.php @@ -1512,11 +1512,7 @@ public function sessionRemove($key) */ public function sessionRemember($key, $default) { - if (!$this->sessionHas($key)) { - $this->sessionSave($key, $default); - } - - return $this->session($key); + return $this->session->remember($key, $default); } /** diff --git a/src/Foundation/Path.php b/src/Foundation/Path.php index 98f03c3..213efed 100644 --- a/src/Foundation/Path.php +++ b/src/Foundation/Path.php @@ -78,7 +78,12 @@ public static function toFramework($append = '') public static function toProject($append = '') { if (!isset(static::$toProject)) { - static::$toProject = str(realpath(__DIR__.'/../../../../../'))->ensureEnd(Os::slash()); + if (isset($_SERVER['PWD'])) { + static::$toProject = dirname(realpath($_SERVER['PWD'].DIRECTORY_SEPARATOR.$_SERVER['SCRIPT_FILENAME'])).DIRECTORY_SEPARATOR; + } else { + // static::$toProject = str(realpath(__DIR__.'/../../../../../'))->ensureEnd(Os::slash()); + static::$toProject = dirname(realpath($_SERVER['SCRIPT_FILENAME'].DIRECTORY_SEPARATOR.'..')).DIRECTORY_SEPARATOR; + } } return static::$toProject.$append; diff --git a/src/Menu/Traits/Session.php b/src/Menu/Traits/Session.php index a41a791..d0e5f81 100644 --- a/src/Menu/Traits/Session.php +++ b/src/Menu/Traits/Session.php @@ -8,7 +8,9 @@ trait Session { /** - * Allows developer to save a value in the session. + * Allows developer to save a value in the session. This does not persist the value to storage + * automatically. The value is persisted only at the end of the request (when the framework + * sends a response back to the user.). * * @param string $name * @param mixed $value @@ -21,7 +23,7 @@ public function sessionSave($name, $value) } /** - * Allow developer to retrieve a previously saved value from the session. + * Allows developer to retrieve a previously saved value from the session. * * Returns the value associated to $name, if found. If the key $name is not * in the session, it returns the $default passed. If no $default was @@ -40,7 +42,7 @@ public function sessionGet($name, $default = null) } /** - * Allow developer to check if the session contains an index. + * Allows developer to check if the session contains an index. * * @param string $name * @@ -52,7 +54,7 @@ public function sessionHas($name) } /** - * Allow the developer to remove a key from the session. + * Allows the developer to remove a key from the session. * * @param string $name * @@ -64,15 +66,28 @@ public function sessionRemove($name) } /** - * Allow the developer to retrieve a value from the session. - * This is identical to `sessionGet`. + * Returns the session value of `$key` if `$key` is in the session, else returns `$default` and + * save `$default` to the session. + * + * @param string $key + * @param mixed $default + * + * @return mixed + */ + public function sessionRemember($key, $default) + { + return $this->session()->remember($key, $default); + } + + /** + * Get the session instance. Can also be used as `sessionGet` by passing $key with/out $default. * * @param string $key * @param mixed $default * * @throws \RuntimeException If $key not found and no $default passed. * - * @return mixed + * @return \Rejoice\Session\SessionInterface|mixed */ public function session($key = null, $default = null) { diff --git a/src/Session/Session.php b/src/Session/Session.php index 81a4eba..1cf0ff9 100644 --- a/src/Session/Session.php +++ b/src/Session/Session.php @@ -205,6 +205,24 @@ public function set(string $key, $value) return $this; } + /** + * Returns the session value of `$key` if `$key` is in the session, else returns `$default` and + * save `$default` to the session. + * + * @param string $key + * @param mixed $default + * + * @return mixed + */ + public function remember($key, $default) + { + if (!$this->has($key)) { + $this->set($key, $default); + } + + return $this->get($key); + } + /** * Remove a key from the part of the session accessible by the developer. * diff --git a/src/Session/SessionInterface.php b/src/Session/SessionInterface.php index 97b4f79..02a5ba2 100644 --- a/src/Session/SessionInterface.php +++ b/src/Session/SessionInterface.php @@ -37,7 +37,7 @@ public function reset(); * @return void */ public function hardReset(); - + /** * Attempts to retrieve a previous session data from the storage. * @@ -55,4 +55,47 @@ public function previousSessionNotExists(); * @return void */ public function save(); + + /** + * Retrieve a value from the part of the session accessible by the developer. + * + * @param string $key + * @param mixed $default + * + * @throws \RuntimeException If value not found and no default value has been provided + * + * @return mixed + */ + public function get($key = null, $default = null); + + /** + * Set a value into the part of the session accessible by the developer. + * + * @param mixed $value + * + * @return void + */ + public function set(string $key, $value); + + /** + * Remove a key from the part of the session accessible by the developer. + * + * Returns true if the key exists and has been removed. False otherwise + * + * @param string $key + * + * @return bool + */ + public function remove($key); + + /** + * Returns the session value of `$key` if `$key` is in the session, else returns `$default` and + * save `$default` to the session. + * + * @param string $key + * @param mixed $default + * + * @return mixed + */ + public function remember($key, $default); } From 871bcad34a95c0e6ed143dc05b456c1fc6766d93 Mon Sep 17 00:00:00 2001 From: Prince Dorcis Date: Fri, 16 Apr 2021 21:56:18 +0000 Subject: [PATCH 15/45] remove debug dump from config/rejoice.php --- config/rejoice.php | 1 - 1 file changed, 1 deletion(-) diff --git a/config/rejoice.php b/config/rejoice.php index 7dee8da..ed5984e 100644 --- a/config/rejoice.php +++ b/config/rejoice.php @@ -2,7 +2,6 @@ use Rejoice\Foundation\Path; -dump($projectRoot = Path::toProject()); $frameworkRoot = Path::toFramework(); return [ From 61bf002caeb768c6925962c2f11e1637ba97a73e Mon Sep 17 00:00:00 2001 From: Prince Dorcis Date: Fri, 16 Apr 2021 22:00:09 +0000 Subject: [PATCH 16/45] fix config/rejoice.php --- config/rejoice.php | 1 + 1 file changed, 1 insertion(+) diff --git a/config/rejoice.php b/config/rejoice.php index ed5984e..2ff8f7e 100644 --- a/config/rejoice.php +++ b/config/rejoice.php @@ -2,6 +2,7 @@ use Rejoice\Foundation\Path; +$projectRoot = Path::toProject(); $frameworkRoot = Path::toFramework(); return [ From add8f50318669ab8f5003d426a3c841337440903 Mon Sep 17 00:00:00 2001 From: Prince Dorcis Date: Sat, 17 Apr 2021 01:33:00 +0000 Subject: [PATCH 17/45] Revert Path and disable symlink --- .../Commands/SimulatorConsoleCommand.php | 19 ++++++++++--------- src/Foundation/Path.php | 19 +++++++++++++------ 2 files changed, 23 insertions(+), 15 deletions(-) diff --git a/src/Console/Commands/SimulatorConsoleCommand.php b/src/Console/Commands/SimulatorConsoleCommand.php index 46f52e6..9040bbc 100644 --- a/src/Console/Commands/SimulatorConsoleCommand.php +++ b/src/Console/Commands/SimulatorConsoleCommand.php @@ -2,11 +2,11 @@ namespace Rejoice\Console\Commands; -use function Prinx\Dotenv\env; use Prinx\Str; use Prinx\Utils\URL; use Rejoice\Console\Option; use Rejoice\Simulator\Libs\Simulator; +use function Prinx\Dotenv\env; class SimulatorConsoleCommand extends FrameworkCommand { @@ -23,9 +23,9 @@ class SimulatorConsoleCommand extends FrameworkCommand const APP_REQUEST_USER_SENT_RESPONSE = '18'; protected $simulatorMetadata = [ - 'info' => 'question', + 'info' => 'question', 'warning' => 'warning', - 'error' => 'error', + 'error' => 'error', ]; public function configure() @@ -103,7 +103,7 @@ public function init() public function simulate() { - $simulator = new Simulator; + $simulator = new Simulator(); $simulator->setEndpoint($this->endpoint); $this->dial(); @@ -111,6 +111,7 @@ public function simulate() while (!$this->isLastMenu($this->payload)) { $simulator->setPayload($this->payload); $response = $simulator->callUssd(); + $responseData = json_decode($response->get('data'), true); if ($response->isSuccess() && is_array($responseData)) { @@ -139,12 +140,12 @@ public function simulate() public function dial() { $this->payload = [ - $this->requestTypeParameter => self::APP_REQUEST_INIT, + $this->requestTypeParameter => self::APP_REQUEST_INIT, $this->userResponseParameter => $this->getOption('ussd_code'), - $this->userNumberParameter => $this->getOption('tel'), - $this->userNetworkParameter => $this->getOption('network'), - $this->sessionIdParameter => time(), - 'channel' => $this->getOption('channel'), + $this->userNumberParameter => $this->getOption('tel'), + $this->userNetworkParameter => $this->getOption('network'), + $this->sessionIdParameter => time(), + 'channel' => $this->getOption('channel'), ]; } diff --git a/src/Foundation/Path.php b/src/Foundation/Path.php index 213efed..3660587 100644 --- a/src/Foundation/Path.php +++ b/src/Foundation/Path.php @@ -63,6 +63,12 @@ public static function toFramework($append = '') { if (!isset(static::$toFramework)) { static::$toFramework = str(realpath(__DIR__.'/../../'))->ensureEnd(Os::slash()); + + // if (isset($_SERVER['PWD'])) { + // static::$toFramework = dirname(realpath($_SERVER['PWD'].DIRECTORY_SEPARATOR.$_SERVER['SCRIPT_FILENAME'])).DIRECTORY_SEPARATOR.'vendor'.DIRECTORY_SEPARATOR.'rejoice'.DIRECTORY_SEPARATOR.'framework'.DIRECTORY_SEPARATOR; + // } else { + // static::$toFramework = dirname(realpath($_SERVER['SCRIPT_FILENAME'].DIRECTORY_SEPARATOR.'..')).DIRECTORY_SEPARATOR.'vendor'.DIRECTORY_SEPARATOR.'rejoice'.DIRECTORY_SEPARATOR.'framework'.DIRECTORY_SEPARATOR; + // } } return static::$toFramework.$append; @@ -78,12 +84,13 @@ public static function toFramework($append = '') public static function toProject($append = '') { if (!isset(static::$toProject)) { - if (isset($_SERVER['PWD'])) { - static::$toProject = dirname(realpath($_SERVER['PWD'].DIRECTORY_SEPARATOR.$_SERVER['SCRIPT_FILENAME'])).DIRECTORY_SEPARATOR; - } else { - // static::$toProject = str(realpath(__DIR__.'/../../../../../'))->ensureEnd(Os::slash()); - static::$toProject = dirname(realpath($_SERVER['SCRIPT_FILENAME'].DIRECTORY_SEPARATOR.'..')).DIRECTORY_SEPARATOR; - } + static::$toProject = str(realpath(__DIR__.'/../../../../../'))->ensureEnd(Os::slash()); + + // if (isset($_SERVER['PWD'])) { + // static::$toProject = dirname(realpath($_SERVER['PWD'].DIRECTORY_SEPARATOR.$_SERVER['SCRIPT_FILENAME'])).DIRECTORY_SEPARATOR; + // } else { + // static::$toProject = dirname(realpath($_SERVER['SCRIPT_FILENAME'].DIRECTORY_SEPARATOR.'..')).DIRECTORY_SEPARATOR; + // } } return static::$toProject.$append; From 4b26dac90be8de866db42e645d39088d04469c1c Mon Sep 17 00:00:00 2001 From: Prince Dorcis Date: Sat, 17 Apr 2021 06:08:05 +0000 Subject: [PATCH 18/45] Removed comment --- src/Foundation/Path.php | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/src/Foundation/Path.php b/src/Foundation/Path.php index 3660587..98f03c3 100644 --- a/src/Foundation/Path.php +++ b/src/Foundation/Path.php @@ -63,12 +63,6 @@ public static function toFramework($append = '') { if (!isset(static::$toFramework)) { static::$toFramework = str(realpath(__DIR__.'/../../'))->ensureEnd(Os::slash()); - - // if (isset($_SERVER['PWD'])) { - // static::$toFramework = dirname(realpath($_SERVER['PWD'].DIRECTORY_SEPARATOR.$_SERVER['SCRIPT_FILENAME'])).DIRECTORY_SEPARATOR.'vendor'.DIRECTORY_SEPARATOR.'rejoice'.DIRECTORY_SEPARATOR.'framework'.DIRECTORY_SEPARATOR; - // } else { - // static::$toFramework = dirname(realpath($_SERVER['SCRIPT_FILENAME'].DIRECTORY_SEPARATOR.'..')).DIRECTORY_SEPARATOR.'vendor'.DIRECTORY_SEPARATOR.'rejoice'.DIRECTORY_SEPARATOR.'framework'.DIRECTORY_SEPARATOR; - // } } return static::$toFramework.$append; @@ -85,12 +79,6 @@ public static function toProject($append = '') { if (!isset(static::$toProject)) { static::$toProject = str(realpath(__DIR__.'/../../../../../'))->ensureEnd(Os::slash()); - - // if (isset($_SERVER['PWD'])) { - // static::$toProject = dirname(realpath($_SERVER['PWD'].DIRECTORY_SEPARATOR.$_SERVER['SCRIPT_FILENAME'])).DIRECTORY_SEPARATOR; - // } else { - // static::$toProject = dirname(realpath($_SERVER['SCRIPT_FILENAME'].DIRECTORY_SEPARATOR.'..')).DIRECTORY_SEPARATOR; - // } } return static::$toProject.$append; From 0f90dccec74f0ba0db2086965826c4f675a81983 Mon Sep 17 00:00:00 2001 From: Prince Dorcis Date: Sat, 17 Apr 2021 06:20:31 +0000 Subject: [PATCH 19/45] sendSms supports array message --- src/Utils/SmsService.php | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/Utils/SmsService.php b/src/Utils/SmsService.php index 088d461..d2b1f88 100644 --- a/src/Utils/SmsService.php +++ b/src/Utils/SmsService.php @@ -34,8 +34,22 @@ public function __construct(Kernel $app) $this->app = $app; } + /** + * Send SMS. + * + * @param string[]|string $message + * @param string $msisdn + * @param string $senderName + * @param string $endpoint + * + * @return void + */ public function send($message, $msisdn = '', $senderName = '', $endpoint = '') { + if (is_array($message)) { + $message = implode("\n", $message); + } + if (!($message = trim($message))) { return; } @@ -84,7 +98,7 @@ public function callSmsApi($postvars, $endpoint) curl_close($curlHandle); return [ - 'data' => $result, + 'data' => $result, 'error' => $err, ]; } From ead8e74476b9630c102fbfda73ac11e20ad6a53a Mon Sep 17 00:00:00 2001 From: Prince Dorcis Date: Sat, 17 Apr 2021 06:32:49 +0000 Subject: [PATCH 20/45] withBack action method supports trigger and display for the back action --- src/Menu/Traits/Action.php | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/Menu/Traits/Action.php b/src/Menu/Traits/Action.php index 999ce5c..a9198ec 100644 --- a/src/Menu/Traits/Action.php +++ b/src/Menu/Traits/Action.php @@ -10,7 +10,6 @@ trait Action /** * Merge an action array with an actionBag. * - * * @param array $actionBag * @param array $mergeWith * @@ -57,7 +56,7 @@ public function mainMenuAction($trigger = '', $display = '') return [ $trigger => [ - ITEM_MSG => $display, + ITEM_MSG => $display, ITEM_ACTION => APP_WELCOME, ], ]; @@ -100,7 +99,7 @@ public function backAction($trigger = '', $display = '') return [ $trigger => [ - ITEM_MSG => $display, + ITEM_MSG => $display, ITEM_ACTION => APP_BACK, ], ]; @@ -109,7 +108,7 @@ public function backAction($trigger = '', $display = '') /** * Return an action bag containing a `go to previous menu` option, as an array. * - * Alias for the `backAction` method. + * Alias for the `backAction`. * * @param string $trigger * @param string $display @@ -158,7 +157,7 @@ public function paginateBackAction($trigger = '', $display = '') return [ $trigger => [ - ITEM_MSG => $display, + ITEM_MSG => $display, ITEM_ACTION => APP_PAGINATE_BACK, ], ]; @@ -200,7 +199,7 @@ public function paginateForwardAction($trigger = '', $display = '') return [ $trigger => [ - ITEM_MSG => $display, + ITEM_MSG => $display, ITEM_ACTION => APP_PAGINATE_FORWARD, ], ]; @@ -242,7 +241,7 @@ public function endAction($trigger = '', $display = '') return [ $trigger => [ - ITEM_MSG => $display, + ITEM_MSG => $display, ITEM_ACTION => APP_END, ], ]; @@ -255,9 +254,9 @@ public function endAction($trigger = '', $display = '') * * @return array */ - public function withBack($actionBag = []) + public function withBack($actionBag = [], $backTrigger = '', $display = '') { - return $this->mergeAction($actionBag, $this->backAction()); + return $this->mergeAction($actionBag, $this->backAction($backTrigger, $display)); } /** From 8ed01f7bea053df56474845fc3bf5b2f9dc98d86 Mon Sep 17 00:00:00 2001 From: Prince Dorcis Date: Sat, 17 Apr 2021 06:48:23 +0000 Subject: [PATCH 21/45] SmsService Class overidable --- config/app.php | 26 +++++++++++++++----------- src/Foundation/Kernel.php | 10 ++++++++-- src/{Utils => Sms}/SmsService.php | 4 ++-- src/Sms/SmsServiceInterface.php | 18 ++++++++++++++++++ 4 files changed, 43 insertions(+), 15 deletions(-) rename src/{Utils => Sms}/SmsService.php (97%) create mode 100644 src/Sms/SmsServiceInterface.php diff --git a/config/app.php b/config/app.php index 6cb4037..7b2e048 100644 --- a/config/app.php +++ b/config/app.php @@ -3,7 +3,6 @@ use function Prinx\Dotenv\env; return [ - /* * Unique identifier for this application. */ @@ -35,6 +34,11 @@ */ 'send_sms_enabled' => env('SEND_SMS_ENABLED', true), + /* + * SMS Service + */ + 'sms_service' => \Rejoice\Sms\SmsService::class, + /* * For test purpose. You can enable/disable overall sending of SMS */ @@ -112,19 +116,19 @@ * country */ 'request_param_user_phone_number' => env('USER_PHONE_PARAM_NAME', 'msisdn'), - 'request_param_user_network' => env('USER_NETWORK_PARAM_NAME', 'network'), - 'request_param_session_id' => env('SESSION_ID_PARAM_NAME', 'sessionID'), - 'request_param_request_type' => env('REQUEST_TYPE_PARAM_NAME', 'ussdServiceOp'), - 'request_param_user_response' => env('USER_RESPONSE_PARAM_NAME', 'ussdString'), - 'request_param_menu_string' => env('MENU_STRING_PARAM_NAME', 'message'), + 'request_param_user_network' => env('USER_NETWORK_PARAM_NAME', 'network'), + 'request_param_session_id' => env('SESSION_ID_PARAM_NAME', 'sessionID'), + 'request_param_request_type' => env('REQUEST_TYPE_PARAM_NAME', 'ussdServiceOp'), + 'request_param_user_response' => env('USER_RESPONSE_PARAM_NAME', 'ussdString'), + 'request_param_menu_string' => env('MENU_STRING_PARAM_NAME', 'message'), /* * Request type codes */ - 'request_init' => env('REQUEST_INIT_CODE', '1'), - 'request_end' => env('REQUEST_END_CODE', '17'), - 'request_failed' => env('REQUEST_FAILED_CODE', '3'), - 'request_cancelled' => env('REQUEST_CANCELLED_CODE', '30'), - 'request_ask_user_response' => env('REQUEST_ASK_USER_RESPONSE_CODE', '2'), + 'request_init' => env('REQUEST_INIT_CODE', '1'), + 'request_end' => env('REQUEST_END_CODE', '17'), + 'request_failed' => env('REQUEST_FAILED_CODE', '3'), + 'request_cancelled' => env('REQUEST_CANCELLED_CODE', '30'), + 'request_ask_user_response' => env('REQUEST_ASK_USER_RESPONSE_CODE', '2'), 'request_user_sent_response' => env('REQUEST_USER_SENT_RESPONSE_CODE', '18'), ]; diff --git a/src/Foundation/Kernel.php b/src/Foundation/Kernel.php index 86f4e66..556fe01 100644 --- a/src/Foundation/Kernel.php +++ b/src/Foundation/Kernel.php @@ -21,7 +21,7 @@ use Rejoice\Database\Connections; use Rejoice\Database\DB; use Rejoice\Menu\Menus; -use Rejoice\Utils\SmsService; +use Rejoice\Sms\SmsServiceInterface; /** * Main Library. Handle the request and return a response. @@ -1834,7 +1834,13 @@ public function sendSms($message, $msisdn = '', $senderName = '', $endpoint = '' return; } - $smsService = new SmsService($this); + $smsServiceClass = $this->config('app.sms_service'); + + if (!($smsServiceClass instanceof SmsServiceInterface)) { + throw new \Exception('Sms Service class must implements "'.SmsServiceInterface::class.'" interface.'); + } + + $smsService = new $smsServiceClass($this); return $smsService->send($message, $msisdn, $senderName, $endpoint); } diff --git a/src/Utils/SmsService.php b/src/Sms/SmsService.php similarity index 97% rename from src/Utils/SmsService.php rename to src/Sms/SmsService.php index d2b1f88..b5cecb6 100644 --- a/src/Utils/SmsService.php +++ b/src/Sms/SmsService.php @@ -9,7 +9,7 @@ * file that was distributed with this source code. */ -namespace Rejoice\Utils; +namespace Rejoice\Sms; use Rejoice\Foundation\Kernel; @@ -18,7 +18,7 @@ * * @author Prince Dorcis */ -class SmsService +class SmsService implements SmsServiceInterface { protected $app; diff --git a/src/Sms/SmsServiceInterface.php b/src/Sms/SmsServiceInterface.php new file mode 100644 index 0000000..780b471 --- /dev/null +++ b/src/Sms/SmsServiceInterface.php @@ -0,0 +1,18 @@ + Date: Sat, 17 Apr 2021 06:59:18 +0000 Subject: [PATCH 22/45] add respond with sms --- src/Menu/Traits/Response.php | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/src/Menu/Traits/Response.php b/src/Menu/Traits/Response.php index dec8c26..b474c77 100644 --- a/src/Menu/Traits/Response.php +++ b/src/Menu/Traits/Response.php @@ -100,7 +100,7 @@ public function hardEnd($message) * Sends the final response screen to the user and automatically exits the * script. * - * @param string|array $message + * @param string[]|string $message * * @return void */ @@ -109,6 +109,32 @@ public function respondAndExit($message) $this->hardEnd($message); } + /** + * Sends final response and the same response as SMS. + * + * @param string[]|string $message + * + * @return void + */ + public function respondWithSms($message) + { + $this->respondAndContinue($message); + $this->sendSms(); + } + + /** + * Sends final response and the same response as SMS and exit. + * + * @param string[]|string $message + * + * @return void + */ + public function respondWithSmsAndExit($message) + { + $this->respondAndContinue($message); + $this->sendSmsAndExit($message); + } + /** * Sends the final response screen to the user and automatically exits the * script. From a90920f6f72884b96432d16bb077e87835f0ec65 Mon Sep 17 00:00:00 2001 From: Prince Dorcis Date: Sat, 17 Apr 2021 07:01:19 +0000 Subject: [PATCH 23/45] Apply fixes from StyleCI --- config/app.php | 20 ++++---- config/rejoice.php | 48 +++++++++---------- src/Console/Commands/ClearLogCommand.php | 12 +++-- .../Commands/SimulatorConsoleCommand.php | 16 +++---- src/Menu/BaseMenu.php | 10 ++-- src/Menu/Traits/Action.php | 10 ++-- src/Sms/SmsService.php | 2 +- 7 files changed, 62 insertions(+), 56 deletions(-) diff --git a/config/app.php b/config/app.php index 7b2e048..ea42662 100644 --- a/config/app.php +++ b/config/app.php @@ -116,19 +116,19 @@ * country */ 'request_param_user_phone_number' => env('USER_PHONE_PARAM_NAME', 'msisdn'), - 'request_param_user_network' => env('USER_NETWORK_PARAM_NAME', 'network'), - 'request_param_session_id' => env('SESSION_ID_PARAM_NAME', 'sessionID'), - 'request_param_request_type' => env('REQUEST_TYPE_PARAM_NAME', 'ussdServiceOp'), - 'request_param_user_response' => env('USER_RESPONSE_PARAM_NAME', 'ussdString'), - 'request_param_menu_string' => env('MENU_STRING_PARAM_NAME', 'message'), + 'request_param_user_network' => env('USER_NETWORK_PARAM_NAME', 'network'), + 'request_param_session_id' => env('SESSION_ID_PARAM_NAME', 'sessionID'), + 'request_param_request_type' => env('REQUEST_TYPE_PARAM_NAME', 'ussdServiceOp'), + 'request_param_user_response' => env('USER_RESPONSE_PARAM_NAME', 'ussdString'), + 'request_param_menu_string' => env('MENU_STRING_PARAM_NAME', 'message'), /* * Request type codes */ - 'request_init' => env('REQUEST_INIT_CODE', '1'), - 'request_end' => env('REQUEST_END_CODE', '17'), - 'request_failed' => env('REQUEST_FAILED_CODE', '3'), - 'request_cancelled' => env('REQUEST_CANCELLED_CODE', '30'), - 'request_ask_user_response' => env('REQUEST_ASK_USER_RESPONSE_CODE', '2'), + 'request_init' => env('REQUEST_INIT_CODE', '1'), + 'request_end' => env('REQUEST_END_CODE', '17'), + 'request_failed' => env('REQUEST_FAILED_CODE', '3'), + 'request_cancelled' => env('REQUEST_CANCELLED_CODE', '30'), + 'request_ask_user_response' => env('REQUEST_ASK_USER_RESPONSE_CODE', '2'), 'request_user_sent_response' => env('REQUEST_USER_SENT_RESPONSE_CODE', '18'), ]; diff --git a/config/rejoice.php b/config/rejoice.php index 2ff8f7e..7a76340 100644 --- a/config/rejoice.php +++ b/config/rejoice.php @@ -7,32 +7,32 @@ return [ 'paths' => [ - 'project_root' => $projectRoot, - 'default_env_file' => $projectRoot.'.env', - 'app_root_dir' => $projectRoot.'app/', - 'app_menu_class_dir' => $projectRoot.'app/Menus/', - 'app_model_dir' => $projectRoot.'app/Models/', - 'app_config_dir' => $projectRoot.'config/', - 'app_config_file' => $projectRoot.'config/app.php', - 'app_database_config_file' => $projectRoot.'config/database.php', - 'app_session_config_file' => $projectRoot.'config/session.php', - 'public_root_dir' => $projectRoot.'public/', - 'resource_root_dir' => $projectRoot.'resources/', - 'menu_resource_dir' => $projectRoot.'resources/menus/', - 'storage_root_dir' => $projectRoot.'storage/', - 'cache_root_dir' => $projectRoot.'storage/cache/', - 'app_default_cache_file' => $projectRoot.'storage/cache/rejoice.cache', + 'project_root' => $projectRoot, + 'default_env_file' => $projectRoot.'.env', + 'app_root_dir' => $projectRoot.'app/', + 'app_menu_class_dir' => $projectRoot.'app/Menus/', + 'app_model_dir' => $projectRoot.'app/Models/', + 'app_config_dir' => $projectRoot.'config/', + 'app_config_file' => $projectRoot.'config/app.php', + 'app_database_config_file' => $projectRoot.'config/database.php', + 'app_session_config_file' => $projectRoot.'config/session.php', + 'public_root_dir' => $projectRoot.'public/', + 'resource_root_dir' => $projectRoot.'resources/', + 'menu_resource_dir' => $projectRoot.'resources/menus/', + 'storage_root_dir' => $projectRoot.'storage/', + 'cache_root_dir' => $projectRoot.'storage/cache/', + 'app_default_cache_file' => $projectRoot.'storage/cache/rejoice.cache', 'app_default_log_count_file' => $projectRoot.'storage/cache/.log-count.cache', - 'log_root_dir' => $projectRoot.'storage/logs/', - 'app_default_log_file' => $projectRoot.'storage/logs/rejoice.log', - 'session_root_dir' => $projectRoot.'storage/sessions/', - 'test_root_dir' => $projectRoot.'tests/', - 'app_command_dir' => $projectRoot.'app/Console/Commands/', - 'app_command_file' => $projectRoot.'app/Console/commands.php', + 'log_root_dir' => $projectRoot.'storage/logs/', + 'app_default_log_file' => $projectRoot.'storage/logs/rejoice.log', + 'session_root_dir' => $projectRoot.'storage/sessions/', + 'test_root_dir' => $projectRoot.'tests/', + 'app_command_dir' => $projectRoot.'app/Console/Commands/', + 'app_command_file' => $projectRoot.'app/Console/commands.php', - 'framework_root' => $frameworkRoot, - 'framework_command_dir' => $frameworkRoot.'src/Console/Commands/', + 'framework_root' => $frameworkRoot, + 'framework_command_dir' => $frameworkRoot.'src/Console/Commands/', 'framework_command_file' => $frameworkRoot.'src/Console/commands.php', - 'framework_stub_dir' => $frameworkRoot.'src/Stubs/', + 'framework_stub_dir' => $frameworkRoot.'src/Stubs/', ], ]; diff --git a/src/Console/Commands/ClearLogCommand.php b/src/Console/Commands/ClearLogCommand.php index 5f954c9..6e35bd3 100644 --- a/src/Console/Commands/ClearLogCommand.php +++ b/src/Console/Commands/ClearLogCommand.php @@ -16,17 +16,23 @@ public function configure() $this->setName('log:clear') ->setDescription('Clear log files.') ->addOption( - 'all', 'a', Option::OPTIONAL, + 'all', + 'a', + Option::OPTIONAL, 'Remove both log files created by rejoice and custom log files.', true ) ->addOption( - 'file', 'f', Option::OPTIONAL, + 'file', + 'f', + Option::OPTIONAL, 'Remove only files.', false ) ->addOption( - 'dir', 'd', Option::OPTIONAL, + 'dir', + 'd', + Option::OPTIONAL, 'Remove only directories.', false ); diff --git a/src/Console/Commands/SimulatorConsoleCommand.php b/src/Console/Commands/SimulatorConsoleCommand.php index 9040bbc..43de238 100644 --- a/src/Console/Commands/SimulatorConsoleCommand.php +++ b/src/Console/Commands/SimulatorConsoleCommand.php @@ -2,11 +2,11 @@ namespace Rejoice\Console\Commands; +use function Prinx\Dotenv\env; use Prinx\Str; use Prinx\Utils\URL; use Rejoice\Console\Option; use Rejoice\Simulator\Libs\Simulator; -use function Prinx\Dotenv\env; class SimulatorConsoleCommand extends FrameworkCommand { @@ -23,9 +23,9 @@ class SimulatorConsoleCommand extends FrameworkCommand const APP_REQUEST_USER_SENT_RESPONSE = '18'; protected $simulatorMetadata = [ - 'info' => 'question', + 'info' => 'question', 'warning' => 'warning', - 'error' => 'error', + 'error' => 'error', ]; public function configure() @@ -140,12 +140,12 @@ public function simulate() public function dial() { $this->payload = [ - $this->requestTypeParameter => self::APP_REQUEST_INIT, + $this->requestTypeParameter => self::APP_REQUEST_INIT, $this->userResponseParameter => $this->getOption('ussd_code'), - $this->userNumberParameter => $this->getOption('tel'), - $this->userNetworkParameter => $this->getOption('network'), - $this->sessionIdParameter => time(), - 'channel' => $this->getOption('channel'), + $this->userNumberParameter => $this->getOption('tel'), + $this->userNetworkParameter => $this->getOption('network'), + $this->sessionIdParameter => time(), + 'channel' => $this->getOption('channel'), ]; } diff --git a/src/Menu/BaseMenu.php b/src/Menu/BaseMenu.php index 6d3c646..3f36be7 100644 --- a/src/Menu/BaseMenu.php +++ b/src/Menu/BaseMenu.php @@ -391,10 +391,10 @@ public function db($name = '') } /** - * If the user has just resumed from the previous session (if the current menu is where the + * If the user has just resumed from the previous session (if the current menu is where the * user left on the previous session). * - * @return boolean + * @return bool */ public function hasResumedFromPreviousSessionOnThisMenu() { @@ -404,7 +404,7 @@ public function hasResumedFromPreviousSessionOnThisMenu() /** * Alias for `hasResumedFromLasSessionOnThisMenu`. * - * @return boolean + * @return bool */ public function hasJustResumedFromPreviousSession() { @@ -412,9 +412,9 @@ public function hasJustResumedFromPreviousSession() } /** - * If the current menu flow started with the user choosing "Start from previous session" + * If the current menu flow started with the user choosing "Start from previous session". * - * @return boolean + * @return bool */ public function hasResumedFromPreviousSession() { diff --git a/src/Menu/Traits/Action.php b/src/Menu/Traits/Action.php index a9198ec..2ed549d 100644 --- a/src/Menu/Traits/Action.php +++ b/src/Menu/Traits/Action.php @@ -56,7 +56,7 @@ public function mainMenuAction($trigger = '', $display = '') return [ $trigger => [ - ITEM_MSG => $display, + ITEM_MSG => $display, ITEM_ACTION => APP_WELCOME, ], ]; @@ -99,7 +99,7 @@ public function backAction($trigger = '', $display = '') return [ $trigger => [ - ITEM_MSG => $display, + ITEM_MSG => $display, ITEM_ACTION => APP_BACK, ], ]; @@ -157,7 +157,7 @@ public function paginateBackAction($trigger = '', $display = '') return [ $trigger => [ - ITEM_MSG => $display, + ITEM_MSG => $display, ITEM_ACTION => APP_PAGINATE_BACK, ], ]; @@ -199,7 +199,7 @@ public function paginateForwardAction($trigger = '', $display = '') return [ $trigger => [ - ITEM_MSG => $display, + ITEM_MSG => $display, ITEM_ACTION => APP_PAGINATE_FORWARD, ], ]; @@ -241,7 +241,7 @@ public function endAction($trigger = '', $display = '') return [ $trigger => [ - ITEM_MSG => $display, + ITEM_MSG => $display, ITEM_ACTION => APP_END, ], ]; diff --git a/src/Sms/SmsService.php b/src/Sms/SmsService.php index b5cecb6..b6e0349 100644 --- a/src/Sms/SmsService.php +++ b/src/Sms/SmsService.php @@ -98,7 +98,7 @@ public function callSmsApi($postvars, $endpoint) curl_close($curlHandle); return [ - 'data' => $result, + 'data' => $result, 'error' => $err, ]; } From 793a5611fef3c7aca9018e5c67d5ccffc469b570 Mon Sep 17 00:00:00 2001 From: Prince Dorcis Date: Sat, 17 Apr 2021 18:51:28 +0000 Subject: [PATCH 24/45] Add regex validation error description --- src/Foundation/UserResponseValidator.php | 34 ++++++++++++------------ 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/Foundation/UserResponseValidator.php b/src/Foundation/UserResponseValidator.php index 1b382c5..aa8bde1 100644 --- a/src/Foundation/UserResponseValidator.php +++ b/src/Foundation/UserResponseValidator.php @@ -64,7 +64,7 @@ class UserResponseValidator */ public static function validate($response, $validationRules) { - $validation = new \stdClass; + $validation = new \stdClass(); $validation->validated = true; $rules = $validationRules; @@ -149,7 +149,7 @@ public static function extractRuleAndError($key, $value) } return [ - 'rule' => $rule, + 'rule' => $rule, 'error' => $customError, ]; } @@ -163,7 +163,7 @@ public static function extractRuleAndError($key, $value) */ public static function isString($str) { - $v = new \stdClass; + $v = new \stdClass(); $v->validated = true; if (!is_string($str)) { @@ -178,7 +178,7 @@ public static function isString($str) public static function isMin($num, $min) { - $v = new \stdClass; + $v = new \stdClass(); $v->validated = true; if (!(floatval($num) >= floatval($min))) { @@ -193,7 +193,7 @@ public static function isMin($num, $min) public static function isMax($num, $max) { - $v = new \stdClass; + $v = new \stdClass(); $v->validated = true; if (!(floatval($num) <= floatval($max))) { @@ -208,7 +208,7 @@ public static function isMax($num, $max) public static function isMinLength($str, $minLen) { - $v = new \stdClass; + $v = new \stdClass(); $v->validated = true; if (!Str::isMinLength($str, intval($minLen))) { @@ -223,7 +223,7 @@ public static function isMinLength($str, $minLen) public static function isMaxLength($str, $maxLen) { - $v = new \stdClass; + $v = new \stdClass(); $v->validated = true; if (!Str::isMaxLength($str, intval($maxLen))) { @@ -256,7 +256,7 @@ public static function isMaxLen($str, $num) public static function isAlpha($str) { - $v = new \stdClass; + $v = new \stdClass(); $v->validated = true; if (!Str::isAlphabetic($str)) { @@ -278,7 +278,7 @@ public static function isAlphabetic($str) public static function isAlphaNum($str) { - $v = new \stdClass; + $v = new \stdClass(); $v->validated = true; if (!Str::isAlphanumeric($str)) { @@ -300,7 +300,7 @@ public static function isAlphaNumeric($str) public static function isNumeric($str) { - $v = new \stdClass; + $v = new \stdClass(); $v->validated = true; if (!Str::isNumeric($str)) { @@ -315,7 +315,7 @@ public static function isNumeric($str) public static function isInteger($str) { - $v = new \stdClass; + $v = new \stdClass(); $v->validated = true; if (!Str::isNumeric($str)) { @@ -337,7 +337,7 @@ public static function isInt($str) public static function isFloat($str) { - $v = new \stdClass; + $v = new \stdClass(); $v->validated = true; if (!Str::isFloatNumeric($str)) { @@ -359,7 +359,7 @@ public static function isAmount($str) public static function isTel($str) { - $v = new \stdClass; + $v = new \stdClass(); $v->validated = true; if (!Str::isTelNumber($str)) { @@ -374,7 +374,7 @@ public static function isTel($str) public static function isRegex($str, $pattern) { - $v = new \stdClass; + $v = new \stdClass(); $v->validated = true; $matched = preg_match($pattern, $str); @@ -384,7 +384,7 @@ public static function isRegex($str, $pattern) self::$customErrors['regex'] ?? 'The response does not match the pattern.'; } elseif ($matched === false) { - throw new \Exception('Error in the validation regex: '.$pattern); + throw new \Exception('Regex validation error: '.preg_last_error_msg().". \nRegex: ".$pattern); } return $v; @@ -392,7 +392,7 @@ public static function isRegex($str, $pattern) public static function isDate($date, $format = 'j/n/Y') { - $v = new \stdClass; + $v = new \stdClass(); $v->validated = true; if (!Date::isDate($date, $format)) { @@ -411,7 +411,7 @@ public static function isAge($str) return self::validate($str, [ 'integer' => 'The age must be a number', - 'min:0' => 'The age must be greater than 0', + 'min:0' => 'The age must be greater than 0', 'max:100' => 'The age must be less than 100', ]); } From 6ebf44259d50f4cfffbda504fc7a04edea4aceb9 Mon Sep 17 00:00:00 2001 From: Prince Dorcis Date: Tue, 27 Apr 2021 04:21:08 +0000 Subject: [PATCH 25/45] Add cron scheduler --- composer.json | 3 +- composer.lock | 238 +++++++++++++++++++++++++++++++---------- src/Jobs/Scheduler.php | 130 ++++++++++++++++++++++ 3 files changed, 311 insertions(+), 60 deletions(-) create mode 100644 src/Jobs/Scheduler.php diff --git a/composer.json b/composer.json index 8f2d450..8350b7f 100644 --- a/composer.json +++ b/composer.json @@ -29,7 +29,8 @@ "prinx/os-utils": "^0.0", "psy/psysh": "^0.10", "illuminate/database": "^8.11", - "symfony/finder": "^5.2" + "symfony/finder": "^5.2", + "peppeocchi/php-cron-scheduler": "^4.0" }, "require-dev": { "phpunit/phpunit": "^9.2", diff --git a/composer.lock b/composer.lock index 082437f..701d3d5 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": "2fa6917dafa3b6f1df9c79e6a07550b9", + "content-hash": "916779caa8c3abde82178cf219e384de", "packages": [ { "name": "doctrine/inflector", @@ -101,6 +101,67 @@ ], "time": "2020-05-29T15:13:26+00:00" }, + { + "name": "dragonmantank/cron-expression", + "version": "v3.1.0", + "source": { + "type": "git", + "url": "https://github.com/dragonmantank/cron-expression.git", + "reference": "7a8c6e56ab3ffcc538d05e8155bb42269abf1a0c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/dragonmantank/cron-expression/zipball/7a8c6e56ab3ffcc538d05e8155bb42269abf1a0c", + "reference": "7a8c6e56ab3ffcc538d05e8155bb42269abf1a0c", + "shasum": "" + }, + "require": { + "php": "^7.2|^8.0", + "webmozart/assert": "^1.7.0" + }, + "replace": { + "mtdowling/cron-expression": "^1.0" + }, + "require-dev": { + "phpstan/extension-installer": "^1.0", + "phpstan/phpstan": "^0.12", + "phpstan/phpstan-webmozart-assert": "^0.12.7", + "phpunit/phpunit": "^7.0|^8.0|^9.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Cron\\": "src/Cron/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Chris Tankersley", + "email": "chris@ctankersley.com", + "homepage": "https://github.com/dragonmantank" + } + ], + "description": "CRON for PHP: Calculate the next or previous run date and determine if a CRON expression is due", + "keywords": [ + "cron", + "schedule" + ], + "support": { + "issues": "https://github.com/dragonmantank/cron-expression/issues", + "source": "https://github.com/dragonmantank/cron-expression/tree/v3.1.0" + }, + "funding": [ + { + "url": "https://github.com/dragonmantank", + "type": "github" + } + ], + "time": "2020-11-24T19:55:57+00:00" + }, { "name": "illuminate/collections", "version": "v8.37.0", @@ -585,6 +646,65 @@ }, "time": "2020-12-20T10:01:03+00:00" }, + { + "name": "peppeocchi/php-cron-scheduler", + "version": "v4.0", + "source": { + "type": "git", + "url": "https://github.com/peppeocchi/php-cron-scheduler.git", + "reference": "0acfa032e60f0ea22a27b96a6b15a673a31d3448" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/peppeocchi/php-cron-scheduler/zipball/0acfa032e60f0ea22a27b96a6b15a673a31d3448", + "reference": "0acfa032e60f0ea22a27b96a6b15a673a31d3448", + "shasum": "" + }, + "require": { + "dragonmantank/cron-expression": "^3.0", + "php": "^7.3 || ^8.0" + }, + "require-dev": { + "php-coveralls/php-coveralls": "^2.4", + "phpunit/phpunit": "~9.5", + "swiftmailer/swiftmailer": "~5.4 || ^6.0" + }, + "suggest": { + "swiftmailer/swiftmailer": "Required to send the output of a job to email address/es (~5.4 || ^6.0)." + }, + "type": "library", + "autoload": { + "psr-4": { + "GO\\": "src/GO/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Giuseppe Occhipinti", + "email": "peppeocchi@gmail.com" + }, + { + "name": "Carsten Windler", + "email": "carsten@carstenwindler.de", + "homepage": "http://carstenwindler.de", + "role": "Contributor" + } + ], + "description": "PHP Cron Job Scheduler", + "keywords": [ + "cron job", + "scheduler" + ], + "support": { + "issues": "https://github.com/peppeocchi/php-cron-scheduler/issues", + "source": "https://github.com/peppeocchi/php-cron-scheduler/tree/v4.0" + }, + "time": "2021-04-22T21:32:03+00:00" + }, { "name": "prinx/array-utils", "version": "v0.0.2", @@ -2213,6 +2333,64 @@ } ], "time": "2020-11-12T00:07:28+00:00" + }, + { + "name": "webmozart/assert", + "version": "1.10.0", + "source": { + "type": "git", + "url": "https://github.com/webmozarts/assert.git", + "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozarts/assert/zipball/6964c76c7804814a842473e0c8fd15bab0f18e25", + "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0", + "symfony/polyfill-ctype": "^1.8" + }, + "conflict": { + "phpstan/phpstan": "<0.12.20", + "vimeo/psalm": "<4.6.1 || 4.6.2" + }, + "require-dev": { + "phpunit/phpunit": "^8.5.13" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.10-dev" + } + }, + "autoload": { + "psr-4": { + "Webmozart\\Assert\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Assertions to validate method input/output with nice error messages.", + "keywords": [ + "assert", + "check", + "validate" + ], + "support": { + "issues": "https://github.com/webmozarts/assert/issues", + "source": "https://github.com/webmozarts/assert/tree/1.10.0" + }, + "time": "2021-03-09T10:59:23+00:00" } ], "packages-dev": [ @@ -4375,64 +4553,6 @@ } ], "time": "2020-07-12T23:59:07+00:00" - }, - { - "name": "webmozart/assert", - "version": "1.10.0", - "source": { - "type": "git", - "url": "https://github.com/webmozarts/assert.git", - "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/webmozarts/assert/zipball/6964c76c7804814a842473e0c8fd15bab0f18e25", - "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0", - "symfony/polyfill-ctype": "^1.8" - }, - "conflict": { - "phpstan/phpstan": "<0.12.20", - "vimeo/psalm": "<4.6.1 || 4.6.2" - }, - "require-dev": { - "phpunit/phpunit": "^8.5.13" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.10-dev" - } - }, - "autoload": { - "psr-4": { - "Webmozart\\Assert\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" - } - ], - "description": "Assertions to validate method input/output with nice error messages.", - "keywords": [ - "assert", - "check", - "validate" - ], - "support": { - "issues": "https://github.com/webmozarts/assert/issues", - "source": "https://github.com/webmozarts/assert/tree/1.10.0" - }, - "time": "2021-03-09T10:59:23+00:00" } ], "aliases": [], diff --git a/src/Jobs/Scheduler.php b/src/Jobs/Scheduler.php new file mode 100644 index 0000000..b0192e2 --- /dev/null +++ b/src/Jobs/Scheduler.php @@ -0,0 +1,130 @@ +schedulerCommand = $command; + } + + /** + * Console Output. + * + * @return \Symfony\Component\Console\Output\OutputInterface + */ + public function getSmileOutput() + { + return $this->schedulerCommand->getOutput(); + } + + /** + * Smile console application. + * + * @return \Symfony\Component\Console\Application + */ + public function getSmile() + { + return $this->schedulerCommand->getApplication(); + } + + /** + * Rejoice mock for console. + * + * @return \Rejoice\Foundation\Kernel + */ + public function getRejoice() + { + return $this->schedulerCommand->getRejoice(); + } + + /** + * Rejoice default logger. + * + * @return \Prinx\Notify\Log + */ + public function logger() + { + return $this->getRejoice()->logger(); + } + + /** + * Schedule a Smile Command. + * + * @param array|string|null $arguments + * + * @return Job + */ + public function command(string $command, $arguments = null) + { + return $this->call(function (string $commandName, $arguments) { + try { + $command = $this->getSmile()->find($commandName); + + $input = $this->resolveInput($arguments); + $output = new BufferedOutput(); + + $command->run($input, $output); + + return $output->fetch(); + } catch (CommandNotFoundException $e) { + $this->logger()->error($e->getMessage()); + + return $e->getMessage(); + } catch (\Throwable $th) { + $message = sprintf('Error when executing scheduled command "%s": %s', + $commandName, + $th->getMessage() + ); + + $this->logger()->error($message); + + return $message; + } + }, [ + $command, + $arguments, + ]); + } + + /** + * Resolve input. + * + * @param array|string $arguments + * + * @return InputInterface|StreamableInputInterface + */ + public function resolveInput($arguments) + { + if (is_string($arguments)) { + return new StringInput($arguments); + } + + if (is_array($arguments)) { + return new ArrayInput($arguments); + } + + return new ArgvInput(); + } +} From 79223a3b550e8676f7dce5a34915cbfdf6a62e3a Mon Sep 17 00:00:00 2001 From: Prince Dorcis Date: Tue, 27 Apr 2021 04:21:53 +0000 Subject: [PATCH 26/45] Fix cron scheduler --- src/Jobs/Scheduler.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Jobs/Scheduler.php b/src/Jobs/Scheduler.php index b0192e2..ea997d7 100644 --- a/src/Jobs/Scheduler.php +++ b/src/Jobs/Scheduler.php @@ -1,6 +1,6 @@ Date: Tue, 27 Apr 2021 04:42:06 +0000 Subject: [PATCH 27/45] Refactor scheduler --- config/app.php | 39 ++++++++++++--------- src/Console/Commands/ScheduleRunCommand.php | 28 +++++++++++++++ 2 files changed, 50 insertions(+), 17 deletions(-) create mode 100644 src/Console/Commands/ScheduleRunCommand.php diff --git a/config/app.php b/config/app.php index ea42662..087a115 100644 --- a/config/app.php +++ b/config/app.php @@ -9,7 +9,7 @@ 'id' => env('APP_ID', 'rejoice_ussd'), /* - * The environment of the application + * The environment of the application. */ 'environment' => env('APP_ENV', 'prod'), @@ -25,27 +25,32 @@ /* * If true, and an SMS endpoint and sender name have been configured, every - * last response will be sent as SMS to the user + * last response will be sent as SMS to the user. */ 'always_send_sms_at_end' => false, /* - * For test purpose. You can enable/disable overall sending of SMS + * You can enable/disable overall sending of SMS. */ 'send_sms_enabled' => env('SEND_SMS_ENABLED', true), /* - * SMS Service + * SMS Service. */ 'sms_service' => \Rejoice\Sms\SmsService::class, /* - * For test purpose. You can enable/disable overall sending of SMS + * SMS Service. + */ + 'jobs_class' => \App\Jobs\Job::class, + + /* + * You can enable/disable overall logging. */ 'log_enabled' => env('LOG_ENABLED', true), /* - * You can disabled connection to the application database by turning this to false + * You can disabled connection to the application database by turning this to false. */ 'connect_app_db' => true, @@ -82,7 +87,7 @@ * time has passed, and a response is sent requesting for an input from the * user, that response is displayed. That behavior is used to allow the * application not to time out. So that the user can see the last response, - * no matter how long the USSD menu is. + * no matter how long the USSD menu lasts. */ 'allow_timeout' => true, @@ -116,19 +121,19 @@ * country */ 'request_param_user_phone_number' => env('USER_PHONE_PARAM_NAME', 'msisdn'), - 'request_param_user_network' => env('USER_NETWORK_PARAM_NAME', 'network'), - 'request_param_session_id' => env('SESSION_ID_PARAM_NAME', 'sessionID'), - 'request_param_request_type' => env('REQUEST_TYPE_PARAM_NAME', 'ussdServiceOp'), - 'request_param_user_response' => env('USER_RESPONSE_PARAM_NAME', 'ussdString'), - 'request_param_menu_string' => env('MENU_STRING_PARAM_NAME', 'message'), + 'request_param_user_network' => env('USER_NETWORK_PARAM_NAME', 'network'), + 'request_param_session_id' => env('SESSION_ID_PARAM_NAME', 'sessionID'), + 'request_param_request_type' => env('REQUEST_TYPE_PARAM_NAME', 'ussdServiceOp'), + 'request_param_user_response' => env('USER_RESPONSE_PARAM_NAME', 'ussdString'), + 'request_param_menu_string' => env('MENU_STRING_PARAM_NAME', 'message'), /* * Request type codes */ - 'request_init' => env('REQUEST_INIT_CODE', '1'), - 'request_end' => env('REQUEST_END_CODE', '17'), - 'request_failed' => env('REQUEST_FAILED_CODE', '3'), - 'request_cancelled' => env('REQUEST_CANCELLED_CODE', '30'), - 'request_ask_user_response' => env('REQUEST_ASK_USER_RESPONSE_CODE', '2'), + 'request_init' => env('REQUEST_INIT_CODE', '1'), + 'request_end' => env('REQUEST_END_CODE', '17'), + 'request_failed' => env('REQUEST_FAILED_CODE', '3'), + 'request_cancelled' => env('REQUEST_CANCELLED_CODE', '30'), + 'request_ask_user_response' => env('REQUEST_ASK_USER_RESPONSE_CODE', '2'), 'request_user_sent_response' => env('REQUEST_USER_SENT_RESPONSE_CODE', '18'), ]; diff --git a/src/Console/Commands/ScheduleRunCommand.php b/src/Console/Commands/ScheduleRunCommand.php new file mode 100644 index 0000000..2379e3d --- /dev/null +++ b/src/Console/Commands/ScheduleRunCommand.php @@ -0,0 +1,28 @@ +setName('schedule:run') + ->setDescription('Run the scheduler'); + } + + public function fire() + { + $scheduler = new Scheduler(); + $scheduler->setSchedulerCommand($this); + + $jobs = new $this->config('app.jobs_class'); + $jobs->schedule($scheduler); + + $scheduler->run(); + + return Smile::SUCCESS; + } +} From 219fce63798c99cdb5beb5c060fe56803f075426 Mon Sep 17 00:00:00 2001 From: Prince Dorcis Date: Tue, 27 Apr 2021 04:50:03 +0000 Subject: [PATCH 28/45] Add alias shortcut action methods --- src/Menu/Traits/Action.php | 49 ++++++++++++++++++++++++++++---------- 1 file changed, 36 insertions(+), 13 deletions(-) diff --git a/src/Menu/Traits/Action.php b/src/Menu/Traits/Action.php index 2ed549d..4b358bc 100644 --- a/src/Menu/Traits/Action.php +++ b/src/Menu/Traits/Action.php @@ -27,12 +27,9 @@ public function mergeAction($actionBag, $mergeWith) * (in config/menu.php file). * Same for the display. * - * @param string $trigger - * @param string $display - * * @return array The modified action bag */ - public function insertMainMenuAction($trigger = '', $display = '') + public function insertMainMenuAction(string $trigger = '', string $display = '') { return $this->insertMenuActions($this->mainMenuAction($trigger, $display)); } @@ -44,24 +41,33 @@ public function insertMainMenuAction($trigger = '', $display = '') * (in config/menu.php file). * Same for the display. * - * @param string $trigger - * @param string $display - * * @return array */ - public function mainMenuAction($trigger = '', $display = '') + public function mainMenuAction(string $trigger = '', string $display = '') { $trigger = $trigger ?: $this->app->config('menu.welcome_action_trigger'); $display = $display ?: $this->app->config('menu.welcome_action_display'); return [ $trigger => [ - ITEM_MSG => $display, + ITEM_MSG => $display, ITEM_ACTION => APP_WELCOME, ], ]; } + /** + * Return a `go to main menu` action bag. + * + * Alias for `mainMenuAction` + * + * @return array + */ + public function main(string $trigger = '', string $display = '') + { + return $this->mainMenuAction($trigger, $display); + } + /** * Insert a `go to previous menu` action into the actions. * @@ -99,7 +105,7 @@ public function backAction($trigger = '', $display = '') return [ $trigger => [ - ITEM_MSG => $display, + ITEM_MSG => $display, ITEM_ACTION => APP_BACK, ], ]; @@ -157,7 +163,7 @@ public function paginateBackAction($trigger = '', $display = '') return [ $trigger => [ - ITEM_MSG => $display, + ITEM_MSG => $display, ITEM_ACTION => APP_PAGINATE_BACK, ], ]; @@ -199,7 +205,7 @@ public function paginateForwardAction($trigger = '', $display = '') return [ $trigger => [ - ITEM_MSG => $display, + ITEM_MSG => $display, ITEM_ACTION => APP_PAGINATE_FORWARD, ], ]; @@ -241,12 +247,29 @@ public function endAction($trigger = '', $display = '') return [ $trigger => [ - ITEM_MSG => $display, + ITEM_MSG => $display, ITEM_ACTION => APP_END, ], ]; } + /** + * Return a `end USSD` action. + * + * If no trigger is passed, it will use the configured trigger + * (in config/menu.php file). + * Same for the display. + * + * @param string $trigger + * @param string $display + * + * @return array + */ + public function end($trigger = '', $display = '') + { + return $this->endAction($trigger, $display); + } + /** * Return an action bag after adding the back action to it. * From 57df233cf00492cdb85c84e19f69a04021036fd1 Mon Sep 17 00:00:00 2001 From: Prince Dorcis Date: Tue, 27 Apr 2021 04:51:11 +0000 Subject: [PATCH 29/45] Apply fixes from StyleCI --- config/app.php | 20 ++++++++++---------- src/Foundation/UserResponseValidator.php | 4 ++-- src/Jobs/Scheduler.php | 3 ++- src/Menu/Traits/Action.php | 10 +++++----- 4 files changed, 19 insertions(+), 18 deletions(-) diff --git a/config/app.php b/config/app.php index 087a115..0f09b5d 100644 --- a/config/app.php +++ b/config/app.php @@ -121,19 +121,19 @@ * country */ 'request_param_user_phone_number' => env('USER_PHONE_PARAM_NAME', 'msisdn'), - 'request_param_user_network' => env('USER_NETWORK_PARAM_NAME', 'network'), - 'request_param_session_id' => env('SESSION_ID_PARAM_NAME', 'sessionID'), - 'request_param_request_type' => env('REQUEST_TYPE_PARAM_NAME', 'ussdServiceOp'), - 'request_param_user_response' => env('USER_RESPONSE_PARAM_NAME', 'ussdString'), - 'request_param_menu_string' => env('MENU_STRING_PARAM_NAME', 'message'), + 'request_param_user_network' => env('USER_NETWORK_PARAM_NAME', 'network'), + 'request_param_session_id' => env('SESSION_ID_PARAM_NAME', 'sessionID'), + 'request_param_request_type' => env('REQUEST_TYPE_PARAM_NAME', 'ussdServiceOp'), + 'request_param_user_response' => env('USER_RESPONSE_PARAM_NAME', 'ussdString'), + 'request_param_menu_string' => env('MENU_STRING_PARAM_NAME', 'message'), /* * Request type codes */ - 'request_init' => env('REQUEST_INIT_CODE', '1'), - 'request_end' => env('REQUEST_END_CODE', '17'), - 'request_failed' => env('REQUEST_FAILED_CODE', '3'), - 'request_cancelled' => env('REQUEST_CANCELLED_CODE', '30'), - 'request_ask_user_response' => env('REQUEST_ASK_USER_RESPONSE_CODE', '2'), + 'request_init' => env('REQUEST_INIT_CODE', '1'), + 'request_end' => env('REQUEST_END_CODE', '17'), + 'request_failed' => env('REQUEST_FAILED_CODE', '3'), + 'request_cancelled' => env('REQUEST_CANCELLED_CODE', '30'), + 'request_ask_user_response' => env('REQUEST_ASK_USER_RESPONSE_CODE', '2'), 'request_user_sent_response' => env('REQUEST_USER_SENT_RESPONSE_CODE', '18'), ]; diff --git a/src/Foundation/UserResponseValidator.php b/src/Foundation/UserResponseValidator.php index aa8bde1..8e3b5f3 100644 --- a/src/Foundation/UserResponseValidator.php +++ b/src/Foundation/UserResponseValidator.php @@ -149,7 +149,7 @@ public static function extractRuleAndError($key, $value) } return [ - 'rule' => $rule, + 'rule' => $rule, 'error' => $customError, ]; } @@ -411,7 +411,7 @@ public static function isAge($str) return self::validate($str, [ 'integer' => 'The age must be a number', - 'min:0' => 'The age must be greater than 0', + 'min:0' => 'The age must be greater than 0', 'max:100' => 'The age must be less than 100', ]); } diff --git a/src/Jobs/Scheduler.php b/src/Jobs/Scheduler.php index ea997d7..9d50b1d 100644 --- a/src/Jobs/Scheduler.php +++ b/src/Jobs/Scheduler.php @@ -93,7 +93,8 @@ public function command(string $command, $arguments = null) return $e->getMessage(); } catch (\Throwable $th) { - $message = sprintf('Error when executing scheduled command "%s": %s', + $message = sprintf( + 'Error when executing scheduled command "%s": %s', $commandName, $th->getMessage() ); diff --git a/src/Menu/Traits/Action.php b/src/Menu/Traits/Action.php index 4b358bc..8ac791a 100644 --- a/src/Menu/Traits/Action.php +++ b/src/Menu/Traits/Action.php @@ -50,7 +50,7 @@ public function mainMenuAction(string $trigger = '', string $display = '') return [ $trigger => [ - ITEM_MSG => $display, + ITEM_MSG => $display, ITEM_ACTION => APP_WELCOME, ], ]; @@ -105,7 +105,7 @@ public function backAction($trigger = '', $display = '') return [ $trigger => [ - ITEM_MSG => $display, + ITEM_MSG => $display, ITEM_ACTION => APP_BACK, ], ]; @@ -163,7 +163,7 @@ public function paginateBackAction($trigger = '', $display = '') return [ $trigger => [ - ITEM_MSG => $display, + ITEM_MSG => $display, ITEM_ACTION => APP_PAGINATE_BACK, ], ]; @@ -205,7 +205,7 @@ public function paginateForwardAction($trigger = '', $display = '') return [ $trigger => [ - ITEM_MSG => $display, + ITEM_MSG => $display, ITEM_ACTION => APP_PAGINATE_FORWARD, ], ]; @@ -247,7 +247,7 @@ public function endAction($trigger = '', $display = '') return [ $trigger => [ - ITEM_MSG => $display, + ITEM_MSG => $display, ITEM_ACTION => APP_END, ], ]; From b0b0e1bfbf759da2a7444a4367d723d944e2fc5f Mon Sep 17 00:00:00 2001 From: Prince Dorcis Date: Tue, 27 Apr 2021 04:55:13 +0000 Subject: [PATCH 30/45] Refactor send sms --- src/Foundation/Kernel.php | 7 ++----- src/Sms/SmsServiceInterface.php | 5 +---- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/Foundation/Kernel.php b/src/Foundation/Kernel.php index 556fe01..ab5aa60 100644 --- a/src/Foundation/Kernel.php +++ b/src/Foundation/Kernel.php @@ -1821,14 +1821,11 @@ public function userSavedResponse() * The sender name and endpoint can be configure in the env file or * directly in the config/app.php file * - * @param string $message - * @param string $msisdn - * @param string $senderName - * @param string $endpoint + * @param string[]|string $message * * @return void */ - public function sendSms($message, $msisdn = '', $senderName = '', $endpoint = '') + public function sendSms($message, string $msisdn = '', string $senderName = '', string $endpoint = '') { if (!$this->config('app.send_sms_enabled')) { return; diff --git a/src/Sms/SmsServiceInterface.php b/src/Sms/SmsServiceInterface.php index 780b471..329122a 100644 --- a/src/Sms/SmsServiceInterface.php +++ b/src/Sms/SmsServiceInterface.php @@ -8,11 +8,8 @@ interface SmsServiceInterface * Send SMS. * * @param string[]|string $message - * @param string $msisdn - * @param string $senderName - * @param string $endpoint * * @return void */ - public function send($message, $msisdn = '', $senderName = '', $endpoint = ''); + public function send($message, string $msisdn = '', string $senderName = '', string $endpoint = ''); } From bf636fcfbb1f2a463ca5f9e5a593ab3cb7d88444 Mon Sep 17 00:00:00 2001 From: Prince Dorcis Date: Tue, 27 Apr 2021 05:00:14 +0000 Subject: [PATCH 31/45] Register internal commands --- src/Console/commands.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Console/commands.php b/src/Console/commands.php index 6e71545..4f28755 100644 --- a/src/Console/commands.php +++ b/src/Console/commands.php @@ -10,6 +10,10 @@ NewModelCommand::class, NewMenuCommand::class, DevtoolCommand::class, - ServeCommand::class, - // + ClearCacheCommand::class, + ClearLogCommand::class, + ClearSessionCommand::class, + RunTestCommand::class, + ScheduleRunCommand::class, + // ... ]; From 43520af6b7386505fbb7e127cfcb806733714ff7 Mon Sep 17 00:00:00 2001 From: Prince Dorcis Date: Tue, 27 Apr 2021 05:11:14 +0000 Subject: [PATCH 32/45] Fix clear commands namespaces --- src/Console/Commands/ClearCacheCommand.php | 2 +- src/Console/Commands/ClearLogCommand.php | 2 +- src/Console/Commands/ClearSessionCommand.php | 2 +- src/Console/Commands/RunTestCommand.php | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Console/Commands/ClearCacheCommand.php b/src/Console/Commands/ClearCacheCommand.php index 39d938b..341ad6f 100644 --- a/src/Console/Commands/ClearCacheCommand.php +++ b/src/Console/Commands/ClearCacheCommand.php @@ -1,6 +1,6 @@ Date: Tue, 27 Apr 2021 05:13:28 +0000 Subject: [PATCH 33/45] Fix clear commands namespaces --- src/Console/Commands/ScheduleRunCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Console/Commands/ScheduleRunCommand.php b/src/Console/Commands/ScheduleRunCommand.php index 2379e3d..50f4dda 100644 --- a/src/Console/Commands/ScheduleRunCommand.php +++ b/src/Console/Commands/ScheduleRunCommand.php @@ -1,6 +1,6 @@ Date: Tue, 27 Apr 2021 05:15:59 +0000 Subject: [PATCH 34/45] Register serve cimmand --- src/Console/commands.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Console/commands.php b/src/Console/commands.php index 4f28755..45acaad 100644 --- a/src/Console/commands.php +++ b/src/Console/commands.php @@ -15,5 +15,6 @@ ClearSessionCommand::class, RunTestCommand::class, ScheduleRunCommand::class, + ServeCommand::class, // ... ]; From e1b7bd255fd0f279fb2bce0e486aa1c7d7caa50e Mon Sep 17 00:00:00 2001 From: Prince Dorcis Date: Tue, 27 Apr 2021 05:33:44 +0000 Subject: [PATCH 35/45] Rename session isPrevious to hasPrevious --- src/Foundation/Kernel.php | 2 +- src/Session/Session.php | 2 +- src/Session/SessionInterface.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Foundation/Kernel.php b/src/Foundation/Kernel.php index ab5aa60..e05bff9 100644 --- a/src/Foundation/Kernel.php +++ b/src/Foundation/Kernel.php @@ -342,7 +342,7 @@ public function loadMenus() protected function handleUserRequest() { - if ($this->isFirstRequest() && $this->session->isPrevious()) { + if ($this->isFirstRequest() && $this->session->hasPrevious()) { $this->prepareToLaunchFromPreviousSession(); } elseif ($this->attemptsToCallSubMenuDirectly() && $this->doesNotAllowDirectSubMenuCall()) { $this->forceRestart(); diff --git a/src/Session/Session.php b/src/Session/Session.php index 1cf0ff9..3fd85f6 100644 --- a/src/Session/Session.php +++ b/src/Session/Session.php @@ -109,7 +109,7 @@ protected function deletePreviousData() * * @return bool */ - public function isPrevious() + public function hasPrevious() { return !$this->isNew(); } diff --git a/src/Session/SessionInterface.php b/src/Session/SessionInterface.php index 02a5ba2..2e0d880 100644 --- a/src/Session/SessionInterface.php +++ b/src/Session/SessionInterface.php @@ -18,7 +18,7 @@ */ interface SessionInterface { - public function isPrevious(); + public function hasPrevious(); /** * Delete session data only from the storage. From 7d7ec420f3432de263623a2e30d698d02c59d6eb Mon Sep 17 00:00:00 2001 From: Prince Dorcis Date: Tue, 27 Apr 2021 06:08:12 +0000 Subject: [PATCH 36/45] Fix this->config() without any parameter must return the config instance in kernel --- config/session.php | 23 ++++++++++++++++------- src/Foundation/Config.php | 9 ++++----- src/Foundation/Kernel.php | 3 ++- 3 files changed, 22 insertions(+), 13 deletions(-) diff --git a/config/session.php b/config/session.php index 4e051f8..48c2cb5 100644 --- a/config/session.php +++ b/config/session.php @@ -3,17 +3,26 @@ use function Prinx\Dotenv\env; return [ - 'driver' => env('SESSION_DRIVER', 'file'), // file|database - 'lifetime' => 60 * 5, // expires after 5h (in min) + /* + * The session is invalidated after the lifetime has passed and + * the user will be obliged to restart from the welcome menu. + * Default 18000 (5h, in seconds) + */ + 'lifetime' => 18000, + + /* + * Timeout of the final response + * Default 180 (3 minutes) + */ + 'timeout' => 180, 'database' => [ - 'user' => env('SESSION_DB_USER', ''), + 'user' => env('SESSION_DB_USER', ''), 'password' => env('SESSION_DB_PASS', ''), - 'host' => env('SESSION_DB_HOST', ''), - 'port' => env('SESSION_DB_PORT', ''), - 'dbname' => env('SESSION_DB_NAME', ''), + 'host' => env('SESSION_DB_HOST', ''), + 'port' => env('SESSION_DB_PORT', ''), + 'dbname' => env('SESSION_DB_NAME', ''), ], - ]; diff --git a/src/Foundation/Config.php b/src/Foundation/Config.php index 424e1c4..6442d3d 100644 --- a/src/Foundation/Config.php +++ b/src/Foundation/Config.php @@ -31,8 +31,6 @@ class Config * If array provided as configDirs, the config from those paths will be merge * * @param string|string[] $configDirs The config folder path or an array of paths - * @param string $separator - * @param string $fileSuffix */ public function __construct($configDirs, string $separator = '.', string $fileSuffix = '.php') { @@ -69,8 +67,9 @@ public function loadConfig() * Get a configuration variable from the config. * * @param string $key - * @param mixed $default The default to return if the configuration is not found - * @param bool $silent If true, will shutdown the exception throwing if configuration variable not found and no default was passed. + * @param mixed $default The default to return if the configuration value is not found + * @param bool $silent If silent is false, will throw an exception if configuration variable + * is not found and no default was passed. * * @throws \RuntimeException * @@ -81,7 +80,7 @@ public function get($key = null, $default = null, $silent = false) $argCount = \func_num_args(); if (0 === $argCount) { - return $this->config; + return $this; } $value = Arr::multiKeyGet($key, $this->config); diff --git a/src/Foundation/Kernel.php b/src/Foundation/Kernel.php index e05bff9..f9e8604 100644 --- a/src/Foundation/Kernel.php +++ b/src/Foundation/Kernel.php @@ -657,8 +657,9 @@ protected function switchToRemoteUssd($nextMenu) $this->session->setMetadata('ussd_has_switched', true); $this->session->save(); $this->setUssdRequestType(APP_REQUEST_INIT); + $this->processFromRemoteUssd($nextMenu); - return $this->processFromRemoteUssd($nextMenu); + return; } /** From eda6dd021022d5c5a6176267b970915e64e0ca3e Mon Sep 17 00:00:00 2001 From: Prince Dorcis Date: Tue, 27 Apr 2021 06:18:01 +0000 Subject: [PATCH 37/45] Fix config accessing in kernel --- config/app.php | 32 ++++++++++++++++---------------- src/Foundation/Kernel.php | 2 +- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/config/app.php b/config/app.php index 0f09b5d..d0c2190 100644 --- a/config/app.php +++ b/config/app.php @@ -91,6 +91,12 @@ */ 'allow_timeout' => true, + /* + * If true, you can directly call a sub menu, without passing through + * the normal flow (from the welcome menu till the particular sub menu) + */ + 'allow_direct_sub_menu_call' => false, + /* * Cancel the session whenever there is an error in the user's response */ @@ -105,12 +111,6 @@ */ 'end_on_unhandled_action' => false, - /* - * If true, you can directly call a sub menu, without passing through - * the normal flow (from the welcome menu till the particular sub menu) - */ - 'allow_direct_sub_menu_call' => false, - /* * Delimits variables in stubs files */ @@ -121,19 +121,19 @@ * country */ 'request_param_user_phone_number' => env('USER_PHONE_PARAM_NAME', 'msisdn'), - 'request_param_user_network' => env('USER_NETWORK_PARAM_NAME', 'network'), - 'request_param_session_id' => env('SESSION_ID_PARAM_NAME', 'sessionID'), - 'request_param_request_type' => env('REQUEST_TYPE_PARAM_NAME', 'ussdServiceOp'), - 'request_param_user_response' => env('USER_RESPONSE_PARAM_NAME', 'ussdString'), - 'request_param_menu_string' => env('MENU_STRING_PARAM_NAME', 'message'), + 'request_param_user_network' => env('USER_NETWORK_PARAM_NAME', 'network'), + 'request_param_session_id' => env('SESSION_ID_PARAM_NAME', 'sessionID'), + 'request_param_request_type' => env('REQUEST_TYPE_PARAM_NAME', 'ussdServiceOp'), + 'request_param_user_response' => env('USER_RESPONSE_PARAM_NAME', 'ussdString'), + 'request_param_menu_string' => env('MENU_STRING_PARAM_NAME', 'message'), /* * Request type codes */ - 'request_init' => env('REQUEST_INIT_CODE', '1'), - 'request_end' => env('REQUEST_END_CODE', '17'), - 'request_failed' => env('REQUEST_FAILED_CODE', '3'), - 'request_cancelled' => env('REQUEST_CANCELLED_CODE', '30'), - 'request_ask_user_response' => env('REQUEST_ASK_USER_RESPONSE_CODE', '2'), + 'request_init' => env('REQUEST_INIT_CODE', '1'), + 'request_end' => env('REQUEST_END_CODE', '17'), + 'request_failed' => env('REQUEST_FAILED_CODE', '3'), + 'request_cancelled' => env('REQUEST_CANCELLED_CODE', '30'), + 'request_ask_user_response' => env('REQUEST_ASK_USER_RESPONSE_CODE', '2'), 'request_user_sent_response' => env('REQUEST_USER_SENT_RESPONSE_CODE', '18'), ]; diff --git a/src/Foundation/Kernel.php b/src/Foundation/Kernel.php index f9e8604..05d6fe8 100644 --- a/src/Foundation/Kernel.php +++ b/src/Foundation/Kernel.php @@ -946,7 +946,7 @@ protected function runState($nextMenuName) $this->session->mustNotTimeout() && $cancelMessage = $this->config('menu.cancel_message') ) { - $sep = $this->app->config('menu.seperator_menu_string_and_cancel_message'); + $sep = $this->config('menu.seperator_menu_string_and_cancel_message'); $message .= $sep.$cancelMessage; } From f6af4da1ff7da0e4d0f729cad752da990fe56ed3 Mon Sep 17 00:00:00 2001 From: Prince Dorcis Date: Tue, 27 Apr 2021 09:09:26 +0000 Subject: [PATCH 38/45] Apply fixes from StyleCI --- config/app.php | 20 ++++++++++---------- config/session.php | 10 +++++----- src/Foundation/Kernel.php | 1 - 3 files changed, 15 insertions(+), 16 deletions(-) diff --git a/config/app.php b/config/app.php index d0c2190..09fe69b 100644 --- a/config/app.php +++ b/config/app.php @@ -121,19 +121,19 @@ * country */ 'request_param_user_phone_number' => env('USER_PHONE_PARAM_NAME', 'msisdn'), - 'request_param_user_network' => env('USER_NETWORK_PARAM_NAME', 'network'), - 'request_param_session_id' => env('SESSION_ID_PARAM_NAME', 'sessionID'), - 'request_param_request_type' => env('REQUEST_TYPE_PARAM_NAME', 'ussdServiceOp'), - 'request_param_user_response' => env('USER_RESPONSE_PARAM_NAME', 'ussdString'), - 'request_param_menu_string' => env('MENU_STRING_PARAM_NAME', 'message'), + 'request_param_user_network' => env('USER_NETWORK_PARAM_NAME', 'network'), + 'request_param_session_id' => env('SESSION_ID_PARAM_NAME', 'sessionID'), + 'request_param_request_type' => env('REQUEST_TYPE_PARAM_NAME', 'ussdServiceOp'), + 'request_param_user_response' => env('USER_RESPONSE_PARAM_NAME', 'ussdString'), + 'request_param_menu_string' => env('MENU_STRING_PARAM_NAME', 'message'), /* * Request type codes */ - 'request_init' => env('REQUEST_INIT_CODE', '1'), - 'request_end' => env('REQUEST_END_CODE', '17'), - 'request_failed' => env('REQUEST_FAILED_CODE', '3'), - 'request_cancelled' => env('REQUEST_CANCELLED_CODE', '30'), - 'request_ask_user_response' => env('REQUEST_ASK_USER_RESPONSE_CODE', '2'), + 'request_init' => env('REQUEST_INIT_CODE', '1'), + 'request_end' => env('REQUEST_END_CODE', '17'), + 'request_failed' => env('REQUEST_FAILED_CODE', '3'), + 'request_cancelled' => env('REQUEST_CANCELLED_CODE', '30'), + 'request_ask_user_response' => env('REQUEST_ASK_USER_RESPONSE_CODE', '2'), 'request_user_sent_response' => env('REQUEST_USER_SENT_RESPONSE_CODE', '18'), ]; diff --git a/config/session.php b/config/session.php index 48c2cb5..227d0da 100644 --- a/config/session.php +++ b/config/session.php @@ -16,13 +16,13 @@ * Timeout of the final response * Default 180 (3 minutes) */ - 'timeout' => 180, + 'timeout' => 180, 'database' => [ - 'user' => env('SESSION_DB_USER', ''), + 'user' => env('SESSION_DB_USER', ''), 'password' => env('SESSION_DB_PASS', ''), - 'host' => env('SESSION_DB_HOST', ''), - 'port' => env('SESSION_DB_PORT', ''), - 'dbname' => env('SESSION_DB_NAME', ''), + 'host' => env('SESSION_DB_HOST', ''), + 'port' => env('SESSION_DB_PORT', ''), + 'dbname' => env('SESSION_DB_NAME', ''), ], ]; diff --git a/src/Foundation/Kernel.php b/src/Foundation/Kernel.php index 05d6fe8..5fb013c 100644 --- a/src/Foundation/Kernel.php +++ b/src/Foundation/Kernel.php @@ -659,7 +659,6 @@ protected function switchToRemoteUssd($nextMenu) $this->setUssdRequestType(APP_REQUEST_INIT); $this->processFromRemoteUssd($nextMenu); - return; } /** From 496a3be7b543a482fbf18de6768bacd50accde0a Mon Sep 17 00:00:00 2001 From: Prince Dorcis Date: Tue, 27 Apr 2021 09:38:37 +0000 Subject: [PATCH 39/45] Update database config file --- config/database.php | 60 ++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 54 insertions(+), 6 deletions(-) diff --git a/config/database.php b/config/database.php index 85331cb..cfe2862 100644 --- a/config/database.php +++ b/config/database.php @@ -4,12 +4,60 @@ return [ - 'default' => [ - 'user' => env('APP_DEFAULT_DB_USER', ''), - 'password' => env('APP_DEFAULT_DB_PASS', ''), - 'host' => env('APP_DEFAULT_DB_HOST', ''), - 'port' => env('APP_DEFAULT_DB_PORT', ''), - 'dbname' => env('APP_DEFAULT_DB_NAME', ''), + 'default' => env('APP_DB_CONNECTION', 'mysql'), + + 'connections' => [ + + 'mysql' => [ + 'driver' => 'mysql', + 'host' => env('APP_DB_HOST', '127.0.0.1'), + 'port' => env('APP_DB_PORT', '3306'), + 'database' => env('APP_DB_NAME', ''), + 'username' => env('APP_DB_USER', ''), + 'password' => env('APP_DB_PASS', ''), + 'unix_socket' => env('APP_DB_SOCKET', ''), + 'charset' => 'utf8', + 'collation' => 'utf8_unicode_ci', + 'prefix' => '', + 'strict' => false, + 'engine' => null, + ], + + 'sqlite' => [ + 'driver' => 'sqlite', + 'url' => env('APP_DB_URL'), + 'database' => env('APP_DB_NAME', ''), + 'prefix' => '', + 'foreign_key_constraints' => env('APP_DB_FOREIGN_KEYS', true), + ], + + 'pgsql' => [ + 'driver' => 'pgsql', + 'url' => env('APP_DB_URL'), + 'host' => env('APP_DB_HOST', '127.0.0.1'), + 'port' => env('APP_DB_PORT', '5432'), + 'database' => env('APP_DB_NAME', 'forge'), + 'username' => env('APP_DB_USER', 'forge'), + 'password' => env('APP_DB_PASS', ''), + 'charset' => 'utf8', + 'prefix' => '', + 'prefix_indexes' => true, + 'schema' => 'public', + 'sslmode' => 'prefer', + ], + + 'sqlsrv' => [ + 'driver' => 'sqlsrv', + 'url' => env('APP_DB_URL'), + 'host' => env('APP_DB_HOST', 'localhost'), + 'port' => env('APP_DB_PORT', '1433'), + 'database' => env('APP_DB_NAME', 'forge'), + 'username' => env('APP_DB_USER', 'forge'), + 'password' => env('APP_DB_PASS', ''), + 'charset' => 'utf8', + 'prefix' => '', + 'prefix_indexes' => true, + ], ], ]; From 4c9620af6325362c7e72cf222bb2753408776e84 Mon Sep 17 00:00:00 2001 From: Prince Dorcis Date: Tue, 27 Apr 2021 09:40:50 +0000 Subject: [PATCH 40/45] Update menu previous_session_display --- config/database.php | 73 ++++++++++++++++++++++----------------------- config/menu.php | 4 +-- 2 files changed, 36 insertions(+), 41 deletions(-) diff --git a/config/database.php b/config/database.php index cfe2862..efe7244 100644 --- a/config/database.php +++ b/config/database.php @@ -3,61 +3,58 @@ use function Prinx\Dotenv\env; return [ - 'default' => env('APP_DB_CONNECTION', 'mysql'), 'connections' => [ - 'mysql' => [ - 'driver' => 'mysql', - 'host' => env('APP_DB_HOST', '127.0.0.1'), - 'port' => env('APP_DB_PORT', '3306'), - 'database' => env('APP_DB_NAME', ''), - 'username' => env('APP_DB_USER', ''), - 'password' => env('APP_DB_PASS', ''), + 'driver' => 'mysql', + 'host' => env('APP_DB_HOST', '127.0.0.1'), + 'port' => env('APP_DB_PORT', '3306'), + 'database' => env('APP_DB_NAME', ''), + 'username' => env('APP_DB_USER', ''), + 'password' => env('APP_DB_PASS', ''), 'unix_socket' => env('APP_DB_SOCKET', ''), - 'charset' => 'utf8', - 'collation' => 'utf8_unicode_ci', - 'prefix' => '', - 'strict' => false, - 'engine' => null, + 'charset' => 'utf8', + 'collation' => 'utf8_unicode_ci', + 'prefix' => '', + 'strict' => false, + 'engine' => null, ], 'sqlite' => [ - 'driver' => 'sqlite', - 'url' => env('APP_DB_URL'), - 'database' => env('APP_DB_NAME', ''), - 'prefix' => '', + 'driver' => 'sqlite', + 'url' => env('APP_DB_URL'), + 'database' => env('APP_DB_NAME', ''), + 'prefix' => '', 'foreign_key_constraints' => env('APP_DB_FOREIGN_KEYS', true), ], 'pgsql' => [ - 'driver' => 'pgsql', - 'url' => env('APP_DB_URL'), - 'host' => env('APP_DB_HOST', '127.0.0.1'), - 'port' => env('APP_DB_PORT', '5432'), - 'database' => env('APP_DB_NAME', 'forge'), - 'username' => env('APP_DB_USER', 'forge'), - 'password' => env('APP_DB_PASS', ''), - 'charset' => 'utf8', - 'prefix' => '', + 'driver' => 'pgsql', + 'url' => env('APP_DB_URL'), + 'host' => env('APP_DB_HOST', '127.0.0.1'), + 'port' => env('APP_DB_PORT', '5432'), + 'database' => env('APP_DB_NAME', 'forge'), + 'username' => env('APP_DB_USER', 'forge'), + 'password' => env('APP_DB_PASS', ''), + 'charset' => 'utf8', + 'prefix' => '', 'prefix_indexes' => true, - 'schema' => 'public', - 'sslmode' => 'prefer', + 'schema' => 'public', + 'sslmode' => 'prefer', ], 'sqlsrv' => [ - 'driver' => 'sqlsrv', - 'url' => env('APP_DB_URL'), - 'host' => env('APP_DB_HOST', 'localhost'), - 'port' => env('APP_DB_PORT', '1433'), - 'database' => env('APP_DB_NAME', 'forge'), - 'username' => env('APP_DB_USER', 'forge'), - 'password' => env('APP_DB_PASS', ''), - 'charset' => 'utf8', - 'prefix' => '', + 'driver' => 'sqlsrv', + 'url' => env('APP_DB_URL'), + 'host' => env('APP_DB_HOST', 'localhost'), + 'port' => env('APP_DB_PORT', '1433'), + 'database' => env('APP_DB_NAME', 'forge'), + 'username' => env('APP_DB_USER', 'forge'), + 'password' => env('APP_DB_PASS', ''), + 'charset' => 'utf8', + 'prefix' => '', 'prefix_indexes' => true, ], ], - ]; diff --git a/config/menu.php b/config/menu.php index 5b93b63..873fc1a 100644 --- a/config/menu.php +++ b/config/menu.php @@ -1,12 +1,11 @@ 'Do you want to continue from where you left?', 'previous_session_trigger' => '1', - 'previous_session_display' => 'Continue previous session', + 'previous_session_display' => 'Continue', 'restart_session_trigger' => '2', @@ -123,5 +122,4 @@ * Space between the message and a cancel message */ 'seperator_menu_string_and_cancel_message' => "\n\n", - ]; From b670aded9f3adb7fa75ec4da459fb635fcab6c05 Mon Sep 17 00:00:00 2001 From: Prince Dorcis Date: Tue, 27 Apr 2021 14:06:46 +0000 Subject: [PATCH 41/45] Removing html tags for logs going to rejoice.log --- src/Foundation/Kernel.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/Foundation/Kernel.php b/src/Foundation/Kernel.php index 05d6fe8..431f171 100644 --- a/src/Foundation/Kernel.php +++ b/src/Foundation/Kernel.php @@ -1215,6 +1215,8 @@ public function fail($error) $this->response->addErrorInSimulator($error); $this->response->softEnd($this->config('menu.application_failed_message')); + $error = strip_tags($this->br2nl($error)); + $log = "Error:\n".$error."\n\nUser session:\n".json_encode($sessionData, JSON_PRETTY_PRINT); $this->logger->emergency($log); @@ -1228,6 +1230,23 @@ public function fail($error) exit; } + /** + * Convert BR tags to newlines and carriage returns. + * + * @param string The string to convert + * @param string The string to use as line separator + * + * @return string The converted string + * + * @see https://www.php.net/manual/en/function.nl2br.php#115182 + */ + public function br2nl($string, $separator = PHP_EOL) + { + $separator = in_array($separator, ["\n", "\r", "\r\n", "\n\r", chr(30), chr(155), PHP_EOL]) ? $separator : PHP_EOL; + + return preg_replace('/\/i', $separator, $string); + } + protected function runPreviousState() { $this->hasComeBack = true; From 9d5cb8ceddc51f662c6329379e583bcfd3aa16f0 Mon Sep 17 00:00:00 2001 From: Prince Dorcis Date: Tue, 27 Apr 2021 14:13:27 +0000 Subject: [PATCH 42/45] Removed logging user session with pretty print when in prod --- src/Foundation/Kernel.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Foundation/Kernel.php b/src/Foundation/Kernel.php index 431f171..4c88103 100644 --- a/src/Foundation/Kernel.php +++ b/src/Foundation/Kernel.php @@ -1216,8 +1216,9 @@ public function fail($error) $this->response->softEnd($this->config('menu.application_failed_message')); $error = strip_tags($this->br2nl($error)); + $sessionData = $this->isProdEnv() ? json_encode($sessionData) : json_encode($sessionData, JSON_PRETTY_PRINT); - $log = "Error:\n".$error."\n\nUser session:\n".json_encode($sessionData, JSON_PRETTY_PRINT); + $log = "Error:\n".$error."\n\nUser session:\n".$sessionData; $this->logger->emergency($log); From b6e9fad29d17d4118c4b11c31536a4664eeb632b Mon Sep 17 00:00:00 2001 From: Prince Dorcis Date: Tue, 27 Apr 2021 14:35:17 +0000 Subject: [PATCH 43/45] Apply fixes from StyleCI --- config/database.php | 70 +++++++++++++++++++-------------------- src/Foundation/Kernel.php | 1 - 2 files changed, 35 insertions(+), 36 deletions(-) diff --git a/config/database.php b/config/database.php index efe7244..9a8db2d 100644 --- a/config/database.php +++ b/config/database.php @@ -7,53 +7,53 @@ 'connections' => [ 'mysql' => [ - 'driver' => 'mysql', - 'host' => env('APP_DB_HOST', '127.0.0.1'), - 'port' => env('APP_DB_PORT', '3306'), - 'database' => env('APP_DB_NAME', ''), - 'username' => env('APP_DB_USER', ''), - 'password' => env('APP_DB_PASS', ''), + 'driver' => 'mysql', + 'host' => env('APP_DB_HOST', '127.0.0.1'), + 'port' => env('APP_DB_PORT', '3306'), + 'database' => env('APP_DB_NAME', ''), + 'username' => env('APP_DB_USER', ''), + 'password' => env('APP_DB_PASS', ''), 'unix_socket' => env('APP_DB_SOCKET', ''), - 'charset' => 'utf8', - 'collation' => 'utf8_unicode_ci', - 'prefix' => '', - 'strict' => false, - 'engine' => null, + 'charset' => 'utf8', + 'collation' => 'utf8_unicode_ci', + 'prefix' => '', + 'strict' => false, + 'engine' => null, ], 'sqlite' => [ - 'driver' => 'sqlite', - 'url' => env('APP_DB_URL'), - 'database' => env('APP_DB_NAME', ''), - 'prefix' => '', + 'driver' => 'sqlite', + 'url' => env('APP_DB_URL'), + 'database' => env('APP_DB_NAME', ''), + 'prefix' => '', 'foreign_key_constraints' => env('APP_DB_FOREIGN_KEYS', true), ], 'pgsql' => [ - 'driver' => 'pgsql', - 'url' => env('APP_DB_URL'), - 'host' => env('APP_DB_HOST', '127.0.0.1'), - 'port' => env('APP_DB_PORT', '5432'), - 'database' => env('APP_DB_NAME', 'forge'), - 'username' => env('APP_DB_USER', 'forge'), - 'password' => env('APP_DB_PASS', ''), - 'charset' => 'utf8', - 'prefix' => '', + 'driver' => 'pgsql', + 'url' => env('APP_DB_URL'), + 'host' => env('APP_DB_HOST', '127.0.0.1'), + 'port' => env('APP_DB_PORT', '5432'), + 'database' => env('APP_DB_NAME', 'forge'), + 'username' => env('APP_DB_USER', 'forge'), + 'password' => env('APP_DB_PASS', ''), + 'charset' => 'utf8', + 'prefix' => '', 'prefix_indexes' => true, - 'schema' => 'public', - 'sslmode' => 'prefer', + 'schema' => 'public', + 'sslmode' => 'prefer', ], 'sqlsrv' => [ - 'driver' => 'sqlsrv', - 'url' => env('APP_DB_URL'), - 'host' => env('APP_DB_HOST', 'localhost'), - 'port' => env('APP_DB_PORT', '1433'), - 'database' => env('APP_DB_NAME', 'forge'), - 'username' => env('APP_DB_USER', 'forge'), - 'password' => env('APP_DB_PASS', ''), - 'charset' => 'utf8', - 'prefix' => '', + 'driver' => 'sqlsrv', + 'url' => env('APP_DB_URL'), + 'host' => env('APP_DB_HOST', 'localhost'), + 'port' => env('APP_DB_PORT', '1433'), + 'database' => env('APP_DB_NAME', 'forge'), + 'username' => env('APP_DB_USER', 'forge'), + 'password' => env('APP_DB_PASS', ''), + 'charset' => 'utf8', + 'prefix' => '', 'prefix_indexes' => true, ], ], diff --git a/src/Foundation/Kernel.php b/src/Foundation/Kernel.php index b91fc59..9ec2163 100644 --- a/src/Foundation/Kernel.php +++ b/src/Foundation/Kernel.php @@ -658,7 +658,6 @@ protected function switchToRemoteUssd($nextMenu) $this->session->save(); $this->setUssdRequestType(APP_REQUEST_INIT); $this->processFromRemoteUssd($nextMenu); - } /** From 636757f32e2f42edae8b99ffaea2398f4b847a15 Mon Sep 17 00:00:00 2001 From: Prince Dorcis Date: Tue, 27 Apr 2021 14:36:31 +0000 Subject: [PATCH 44/45] Fix comment --- config/app.php | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/config/app.php b/config/app.php index 09fe69b..7557847 100644 --- a/config/app.php +++ b/config/app.php @@ -40,7 +40,7 @@ 'sms_service' => \Rejoice\Sms\SmsService::class, /* - * SMS Service. + * Jobs class. */ 'jobs_class' => \App\Jobs\Job::class, @@ -121,19 +121,19 @@ * country */ 'request_param_user_phone_number' => env('USER_PHONE_PARAM_NAME', 'msisdn'), - 'request_param_user_network' => env('USER_NETWORK_PARAM_NAME', 'network'), - 'request_param_session_id' => env('SESSION_ID_PARAM_NAME', 'sessionID'), - 'request_param_request_type' => env('REQUEST_TYPE_PARAM_NAME', 'ussdServiceOp'), - 'request_param_user_response' => env('USER_RESPONSE_PARAM_NAME', 'ussdString'), - 'request_param_menu_string' => env('MENU_STRING_PARAM_NAME', 'message'), + 'request_param_user_network' => env('USER_NETWORK_PARAM_NAME', 'network'), + 'request_param_session_id' => env('SESSION_ID_PARAM_NAME', 'sessionID'), + 'request_param_request_type' => env('REQUEST_TYPE_PARAM_NAME', 'ussdServiceOp'), + 'request_param_user_response' => env('USER_RESPONSE_PARAM_NAME', 'ussdString'), + 'request_param_menu_string' => env('MENU_STRING_PARAM_NAME', 'message'), /* * Request type codes */ - 'request_init' => env('REQUEST_INIT_CODE', '1'), - 'request_end' => env('REQUEST_END_CODE', '17'), - 'request_failed' => env('REQUEST_FAILED_CODE', '3'), - 'request_cancelled' => env('REQUEST_CANCELLED_CODE', '30'), - 'request_ask_user_response' => env('REQUEST_ASK_USER_RESPONSE_CODE', '2'), + 'request_init' => env('REQUEST_INIT_CODE', '1'), + 'request_end' => env('REQUEST_END_CODE', '17'), + 'request_failed' => env('REQUEST_FAILED_CODE', '3'), + 'request_cancelled' => env('REQUEST_CANCELLED_CODE', '30'), + 'request_ask_user_response' => env('REQUEST_ASK_USER_RESPONSE_CODE', '2'), 'request_user_sent_response' => env('REQUEST_USER_SENT_RESPONSE_CODE', '18'), ]; From e4d9691e9c286044038a472b379987e35c8884f4 Mon Sep 17 00:00:00 2001 From: Prince Dorcis Date: Tue, 27 Apr 2021 14:37:25 +0000 Subject: [PATCH 45/45] Apply fixes from StyleCI --- config/app.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/config/app.php b/config/app.php index 7557847..e9aa4c9 100644 --- a/config/app.php +++ b/config/app.php @@ -121,19 +121,19 @@ * country */ 'request_param_user_phone_number' => env('USER_PHONE_PARAM_NAME', 'msisdn'), - 'request_param_user_network' => env('USER_NETWORK_PARAM_NAME', 'network'), - 'request_param_session_id' => env('SESSION_ID_PARAM_NAME', 'sessionID'), - 'request_param_request_type' => env('REQUEST_TYPE_PARAM_NAME', 'ussdServiceOp'), - 'request_param_user_response' => env('USER_RESPONSE_PARAM_NAME', 'ussdString'), - 'request_param_menu_string' => env('MENU_STRING_PARAM_NAME', 'message'), + 'request_param_user_network' => env('USER_NETWORK_PARAM_NAME', 'network'), + 'request_param_session_id' => env('SESSION_ID_PARAM_NAME', 'sessionID'), + 'request_param_request_type' => env('REQUEST_TYPE_PARAM_NAME', 'ussdServiceOp'), + 'request_param_user_response' => env('USER_RESPONSE_PARAM_NAME', 'ussdString'), + 'request_param_menu_string' => env('MENU_STRING_PARAM_NAME', 'message'), /* * Request type codes */ - 'request_init' => env('REQUEST_INIT_CODE', '1'), - 'request_end' => env('REQUEST_END_CODE', '17'), - 'request_failed' => env('REQUEST_FAILED_CODE', '3'), - 'request_cancelled' => env('REQUEST_CANCELLED_CODE', '30'), - 'request_ask_user_response' => env('REQUEST_ASK_USER_RESPONSE_CODE', '2'), + 'request_init' => env('REQUEST_INIT_CODE', '1'), + 'request_end' => env('REQUEST_END_CODE', '17'), + 'request_failed' => env('REQUEST_FAILED_CODE', '3'), + 'request_cancelled' => env('REQUEST_CANCELLED_CODE', '30'), + 'request_ask_user_response' => env('REQUEST_ASK_USER_RESPONSE_CODE', '2'), 'request_user_sent_response' => env('REQUEST_USER_SENT_RESPONSE_CODE', '18'), ];