From 042660b15c380856e004530aa60104ad65ef377e Mon Sep 17 00:00:00 2001 From: "Eldad A. Fux" Date: Tue, 27 Oct 2020 02:08:29 +0200 Subject: [PATCH] Feat psalm analysis (#699) * Added static code analysis * Updated code to solve psalm issue --- CONTRIBUTING.md | 6 + app/controllers/general.php | 2 +- app/preload.php | 3 + app/tasks/install.php | 4 +- app/workers/functions.php | 12 +- composer.json | 9 +- composer.lock | 1612 +++++++++++++++-- docker-compose.yml | 1 + psalm.xml | 15 + src/Appwrite/Auth/Auth.php | 20 +- src/Appwrite/Auth/OAuth2.php | 8 +- src/Appwrite/Auth/OAuth2/Amazon.php | 5 +- src/Appwrite/Auth/OAuth2/Apple.php | 6 +- src/Appwrite/Auth/OAuth2/Bitbucket.php | 2 +- src/Appwrite/Auth/OAuth2/Discord.php | 2 +- src/Appwrite/Auth/OAuth2/Dropbox.php | 4 +- src/Appwrite/Auth/OAuth2/Microsoft.php | 4 +- src/Appwrite/Auth/OAuth2/Paypal.php | 20 +- src/Appwrite/Auth/OAuth2/Salesforce.php | 2 +- src/Appwrite/Auth/OAuth2/Vk.php | 2 +- src/Appwrite/Auth/OAuth2/Yahoo.php | 2 +- src/Appwrite/Auth/OAuth2/Yandex.php | 2 +- src/Appwrite/Database/Adapter.php | 6 +- src/Appwrite/Database/Adapter/MySQL.php | 30 +- src/Appwrite/Database/Adapter/Redis.php | 8 +- src/Appwrite/Database/Database.php | 35 +- src/Appwrite/Database/Document.php | 10 +- .../Database/Validator/Authorization.php | 26 +- .../Database/Validator/Collection.php | 6 +- .../Database/Validator/DocumentId.php | 2 +- .../Database/Validator/Permissions.php | 4 +- src/Appwrite/Database/Validator/Structure.php | 26 +- src/Appwrite/Database/Validator/UID.php | 12 +- src/Appwrite/Docker/Compose.php | 2 +- src/Appwrite/Docker/Compose/Service.php | 2 +- src/Appwrite/Docker/Env.php | 2 +- src/Appwrite/Extend/PDO.php | 2 +- src/Appwrite/Network/Validator/CNAME.php | 15 +- src/Appwrite/Network/Validator/Origin.php | 6 +- src/Appwrite/OpenSSL/OpenSSL.php | 2 +- src/Appwrite/Resize/Resize.php | 6 +- src/Appwrite/Storage/Device.php | 32 +- src/Appwrite/Storage/Device/Local.php | 6 +- src/Appwrite/Storage/Device/S3.php | 2 +- src/Appwrite/Storage/Storage.php | 6 +- src/Appwrite/Storage/Validator/File.php | 2 +- src/Appwrite/Storage/Validator/FileName.php | 6 +- src/Appwrite/Storage/Validator/FileSize.php | 6 +- src/Appwrite/Storage/Validator/Upload.php | 6 +- src/Appwrite/Swoole/Files.php | 18 +- src/Appwrite/Swoole/Request.php | 9 +- src/Appwrite/Swoole/Response.php | 8 +- src/Appwrite/URL/URL.php | 4 +- src/Appwrite/Utopia/Response.php | 8 +- src/Appwrite/Utopia/Response/Model.php | 5 +- src/Appwrite/Utopia/Response/Model/Error.php | 2 +- src/Appwrite/Utopia/Response/Model/Locale.php | 1 - 57 files changed, 1786 insertions(+), 280 deletions(-) create mode 100644 psalm.xml diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8b7a205a7..a51f482f2 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -281,6 +281,12 @@ php-cs-fixer fix app/controllers --rules='{"braces": {"allow_single_line_closure php-cs-fixer fix src --rules='{"braces": {"allow_single_line_closure": true}}' ``` +Static Code Analysis: + +```bash +docker-compose exec appwrite /usr/src/code/vendor/bin/psalm +``` + ## Tutorials From time to time, our team will add tutorials that will help contributors find their way in the Appwrite source code. Below is a list of currently available tutorials: diff --git a/app/controllers/general.php b/app/controllers/general.php index e7350515c..5aae62ac3 100644 --- a/app/controllers/general.php +++ b/app/controllers/general.php @@ -64,7 +64,7 @@ App::init(function ($utopia, $request, $response, $console, $project, $user, $lo ? $origin : 'localhost') . (!empty($port) ? ':'.$port : ''); $selfDomain = new Domain($request->getHostname()); - $endDomain = new Domain($origin); + $endDomain = new Domain((string)$origin); // var_dump('referer', $referrer); // var_dump('origin', $origin); diff --git a/app/preload.php b/app/preload.php index d58d6717f..9ada9a219 100644 --- a/app/preload.php +++ b/app/preload.php @@ -23,6 +23,9 @@ include __DIR__.'/controllers/general.php'; $preloader = new Preloader(); foreach ([ + realpath(__DIR__ . '/../vendor/composer'), + realpath(__DIR__ . '/../vendor/amphp'), + realpath(__DIR__ . '/../vendor/felixfbecker'), realpath(__DIR__ . '/../vendor/twig/twig'), realpath(__DIR__ . '/../vendor/guzzlehttp/guzzle'), realpath(__DIR__ . '/../vendor/domnikl'), diff --git a/app/tasks/install.php b/app/tasks/install.php index 5345ad627..cd7e2a096 100644 --- a/app/tasks/install.php +++ b/app/tasks/install.php @@ -142,10 +142,10 @@ $cli $stdout = ''; $stderr = ''; - + Console::log("Running \"docker-compose -f {$path}/docker-compose.yml up -d --remove-orphans\""); - $exit = Console::execute("docker-compose -f {$path}/docker-compose.yml up -d --remove-orphans", null, $stdout, $stderr); + $exit = Console::execute("docker-compose -f {$path}/docker-compose.yml up -d --remove-orphans", '', $stdout, $stderr); if ($exit !== 0) { Console::error("Failed to install Appwrite dockers"); diff --git a/app/workers/functions.php b/app/workers/functions.php index 8cbe221e1..296743026 100644 --- a/app/workers/functions.php +++ b/app/workers/functions.php @@ -29,7 +29,7 @@ Co\run(function() use ($environments) { Console::info('Warming up '.$environment['name'].' environment'); - Console::execute('docker pull '.$environment['image'], null, $stdout, $stderr); + Console::execute('docker pull '.$environment['image'], '', $stdout, $stderr); if(!empty($stdout)) { Console::log($stdout); @@ -211,7 +211,7 @@ class FunctionsV1 $executionStart = \microtime(true); $exitCode = Console::execute('docker ps --all --format "name={{.Names}}&status={{.Status}}&labels={{.Labels}}" --filter label=appwrite-type=function' - , null, $stdout, $stderr, 30); + , '', $stdout, $stderr, 30); $executionEnd = \microtime(true); @@ -249,7 +249,7 @@ class FunctionsV1 $stdout = ''; $stderr = ''; - if(Console::execute("docker rm {$container}", null, $stdout, $stderr, 30) !== 0) { + if(Console::execute("docker rm {$container}", '', $stdout, $stderr, 30) !== 0) { throw new Exception('Failed to remove offline container: '.$stderr); } @@ -277,7 +277,7 @@ class FunctionsV1 ".\implode("\n", $vars)." {$environment['image']} \ sh -c 'mv /tmp/code.tar.gz /usr/local/src/code.tar.gz && tar -zxf /usr/local/src/code.tar.gz --strip 1 && rm /usr/local/src/code.tar.gz && tail -f /dev/null'" - , null, $stdout, $stderr, 30); + , '', $stdout, $stderr, 30); $executionEnd = \microtime(true); @@ -297,7 +297,7 @@ class FunctionsV1 $executionStart = \microtime(true); $exitCode = Console::execute("docker exec {$container} {$command}" - , null, $stdout, $stderr, $function->getAttribute('timeout', (int) App::getEnv('_APP_FUNCTIONS_TIMEOUT', 900))); + , '', $stdout, $stderr, $function->getAttribute('timeout', (int) App::getEnv('_APP_FUNCTIONS_TIMEOUT', 900))); $executionEnd = \microtime(true); @@ -345,7 +345,7 @@ class FunctionsV1 $stdout = ''; $stderr = ''; - if(Console::execute("docker stop {$first['name']}", null, $stdout, $stderr, 30) !== 0) { + if(Console::execute("docker stop {$first['name']}", '', $stdout, $stderr, 30) !== 0) { Console::error('Failed to remove container: '.$stderr); } diff --git a/composer.json b/composer.json index c2c3b9d0f..bf121686a 100644 --- a/composer.json +++ b/composer.json @@ -34,16 +34,16 @@ "appwrite/php-clamav": "1.0.*", - "utopia-php/framework": "0.9.1", + "utopia-php/framework": "0.9.6", "utopia-php/abuse": "0.2.*", "utopia-php/audit": "0.3.*", "utopia-php/cache": "0.2.*", - "utopia-php/cli": "0.7.1", + "utopia-php/cli": "0.7.2", "utopia-php/config": "0.2.*", "utopia-php/locale": "0.3.*", "utopia-php/registry": "0.2.*", "utopia-php/preloader": "0.2.*", - "utopia-php/domains": "1.1.*", + "utopia-php/domains": "0.2.*", "resque/php-resque": "1.3.6", "piwik/device-detector": "3.13.0", @@ -56,7 +56,8 @@ "require-dev": { "swoole/ide-helper": "4.5.5", "appwrite/sdk-generator": "master", - "phpunit/phpunit": "^9.3" + "phpunit/phpunit": "^9.3", + "vimeo/psalm": "4.0.1" }, "repositories": [ { diff --git a/composer.lock b/composer.lock index b4be605cc..bb21ed041 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": "6b4324f0371e508d691337551c00c74e", + "content-hash": "7ad12180c132b3225874c7f18594409a", "packages": [ { "name": "appwrite/php-clamav", @@ -1271,16 +1271,16 @@ }, { "name": "utopia-php/cli", - "version": "0.7.1", + "version": "0.7.2", "source": { "type": "git", "url": "https://github.com/utopia-php/cli.git", - "reference": "97e6e027a8d6fa752815acae984ed48daa76a5e8" + "reference": "0b19cd33b86deb6aeb26bfdabc18bd2bdf5eba04" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/cli/zipball/97e6e027a8d6fa752815acae984ed48daa76a5e8", - "reference": "97e6e027a8d6fa752815acae984ed48daa76a5e8", + "url": "https://api.github.com/repos/utopia-php/cli/zipball/0b19cd33b86deb6aeb26bfdabc18bd2bdf5eba04", + "reference": "0b19cd33b86deb6aeb26bfdabc18bd2bdf5eba04", "shasum": "" }, "require": { @@ -1288,7 +1288,8 @@ "utopia-php/framework": "0.*.*" }, "require-dev": { - "phpunit/phpunit": "^7.0" + "phpunit/phpunit": "^9.3", + "vimeo/psalm": "4.0.1" }, "type": "library", "autoload": { @@ -1315,7 +1316,7 @@ "upf", "utopia" ], - "time": "2020-09-15T19:57:49+00:00" + "time": "2020-10-23T13:34:41+00:00" }, { "name": "utopia-php/config", @@ -1366,23 +1367,24 @@ }, { "name": "utopia-php/domains", - "version": "v1.1.0", + "version": "0.2.3", "source": { "type": "git", "url": "https://github.com/utopia-php/domains.git", - "reference": "1665e1d9932afa3be63b5c1e0dcfe01fe77d8e73" + "reference": "6c9b3706b0df4e0150a1f9062321ff114270a643" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/domains/zipball/1665e1d9932afa3be63b5c1e0dcfe01fe77d8e73", - "reference": "1665e1d9932afa3be63b5c1e0dcfe01fe77d8e73", + "url": "https://api.github.com/repos/utopia-php/domains/zipball/6c9b3706b0df4e0150a1f9062321ff114270a643", + "reference": "6c9b3706b0df4e0150a1f9062321ff114270a643", "shasum": "" }, "require": { "php": ">=7.1" }, "require-dev": { - "phpunit/phpunit": "^7.0" + "phpunit/phpunit": "^9.3", + "vimeo/psalm": "4.0.1" }, "type": "library", "autoload": { @@ -1412,27 +1414,28 @@ "upf", "utopia" ], - "time": "2020-02-23T07:40:02+00:00" + "time": "2020-10-23T09:59:51+00:00" }, { "name": "utopia-php/framework", - "version": "0.9.1", + "version": "0.9.6", "source": { "type": "git", "url": "https://github.com/utopia-php/framework.git", - "reference": "1c33b92b9188fb11b2ae70a4b7cf51844e07aa2e" + "reference": "959767e401c0497f0ddf31446d8d4dfa125aa5dc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/framework/zipball/1c33b92b9188fb11b2ae70a4b7cf51844e07aa2e", - "reference": "1c33b92b9188fb11b2ae70a4b7cf51844e07aa2e", + "url": "https://api.github.com/repos/utopia-php/framework/zipball/959767e401c0497f0ddf31446d8d4dfa125aa5dc", + "reference": "959767e401c0497f0ddf31446d8d4dfa125aa5dc", "shasum": "" }, "require": { - "php": ">=7.0.0" + "php": ">=7.3.0" }, "require-dev": { - "phpunit/phpunit": "^7.0" + "phpunit/phpunit": "^9.4", + "vimeo/psalm": "4.0.1" }, "type": "library", "autoload": { @@ -1456,7 +1459,7 @@ "php", "upf" ], - "time": "2020-09-09T19:50:26+00:00" + "time": "2020-10-26T00:20:11+00:00" }, { "name": "utopia-php/locale", @@ -1604,6 +1607,162 @@ } ], "packages-dev": [ + { + "name": "amphp/amp", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/amphp/amp.git", + "reference": "eb2f325586bc6ebb12d27834fc779fa140c38a57" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/amphp/amp/zipball/eb2f325586bc6ebb12d27834fc779fa140c38a57", + "reference": "eb2f325586bc6ebb12d27834fc779fa140c38a57", + "shasum": "" + }, + "require": { + "php": ">=7" + }, + "require-dev": { + "amphp/php-cs-fixer-config": "dev-master", + "amphp/phpunit-util": "^1", + "ext-json": "*", + "jetbrains/phpstorm-stubs": "^2019.3", + "phpunit/phpunit": "^6.0.9 | ^7", + "psalm/phar": "^3.11@dev", + "react/promise": "^2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "autoload": { + "psr-4": { + "Amp\\": "lib" + }, + "files": [ + "lib/functions.php", + "lib/Internal/functions.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Daniel Lowrey", + "email": "rdlowrey@php.net" + }, + { + "name": "Aaron Piotrowski", + "email": "aaron@trowski.com" + }, + { + "name": "Bob Weinand", + "email": "bobwei9@hotmail.com" + }, + { + "name": "Niklas Keller", + "email": "me@kelunik.com" + } + ], + "description": "A non-blocking concurrency framework for PHP applications.", + "homepage": "http://amphp.org/amp", + "keywords": [ + "async", + "asynchronous", + "awaitable", + "concurrency", + "event", + "event-loop", + "future", + "non-blocking", + "promise" + ], + "funding": [ + { + "url": "https://github.com/amphp", + "type": "github" + } + ], + "time": "2020-10-10T13:54:50+00:00" + }, + { + "name": "amphp/byte-stream", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/amphp/byte-stream.git", + "reference": "f813a658f0446192c5e17f96727070ee9342b93a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/amphp/byte-stream/zipball/f813a658f0446192c5e17f96727070ee9342b93a", + "reference": "f813a658f0446192c5e17f96727070ee9342b93a", + "shasum": "" + }, + "require": { + "amphp/amp": "^2", + "php": ">=7.1" + }, + "require-dev": { + "amphp/php-cs-fixer-config": "dev-master", + "amphp/phpunit-util": "^1.4", + "friendsofphp/php-cs-fixer": "^2.3", + "jetbrains/phpstorm-stubs": "^2019.3", + "phpunit/phpunit": "^6 || ^7 || ^8", + "psalm/phar": "^3.11.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Amp\\ByteStream\\": "lib" + }, + "files": [ + "lib/functions.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Aaron Piotrowski", + "email": "aaron@trowski.com" + }, + { + "name": "Niklas Keller", + "email": "me@kelunik.com" + } + ], + "description": "A stream abstraction to make working with non-blocking I/O simple.", + "homepage": "http://amphp.org/byte-stream", + "keywords": [ + "amp", + "amphp", + "async", + "io", + "non-blocking", + "stream" + ], + "funding": [ + { + "url": "https://github.com/amphp", + "type": "github" + } + ], + "time": "2020-08-30T19:23:04+00:00" + }, { "name": "appwrite/sdk-generator", "version": "dev-master", @@ -1642,6 +1801,242 @@ "description": "Appwrite PHP library for generating API SDKs for multiple programming languages and platforms", "time": "2020-10-20T10:23:43+00:00" }, + { + "name": "composer/package-versions-deprecated", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/composer/package-versions-deprecated.git", + "reference": "c8c9aa8a14cc3d3bec86d0a8c3fa52ea79936855" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/package-versions-deprecated/zipball/c8c9aa8a14cc3d3bec86d0a8c3fa52ea79936855", + "reference": "c8c9aa8a14cc3d3bec86d0a8c3fa52ea79936855", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.1.0 || ^2.0", + "php": "^7 || ^8" + }, + "replace": { + "ocramius/package-versions": "1.11.99" + }, + "require-dev": { + "composer/composer": "^1.9.3 || ^2.0@dev", + "ext-zip": "^1.13", + "phpunit/phpunit": "^6.5 || ^7" + }, + "type": "composer-plugin", + "extra": { + "class": "PackageVersions\\Installer", + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "PackageVersions\\": "src/PackageVersions" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com" + }, + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be" + } + ], + "description": "Composer plugin that provides efficient querying for installed package versions (no runtime IO)", + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2020-08-25T05:50:16+00:00" + }, + { + "name": "composer/semver", + "version": "dev-main", + "source": { + "type": "git", + "url": "https://github.com/composer/semver.git", + "reference": "4089fddb67bcf6bf860d91b979e95be303835002" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/semver/zipball/4089fddb67bcf6bf860d91b979e95be303835002", + "reference": "4089fddb67bcf6bf860d91b979e95be303835002", + "shasum": "" + }, + "require": { + "php": "^5.3.2 || ^7.0 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^0.12.19", + "symfony/phpunit-bridge": "^4.2 || ^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Semver\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nils Adermann", + "email": "naderman@naderman.de", + "homepage": "http://www.naderman.de" + }, + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + }, + { + "name": "Rob Bast", + "email": "rob.bast@gmail.com", + "homepage": "http://robbast.nl" + } + ], + "description": "Semver library that offers utilities, version constraint parsing and validation.", + "keywords": [ + "semantic", + "semver", + "validation", + "versioning" + ], + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2020-10-14T08:51:15+00:00" + }, + { + "name": "composer/xdebug-handler", + "version": "1.4.4", + "source": { + "type": "git", + "url": "https://github.com/composer/xdebug-handler.git", + "reference": "6e076a124f7ee146f2487554a94b6a19a74887ba" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/6e076a124f7ee146f2487554a94b6a19a74887ba", + "reference": "6e076a124f7ee146f2487554a94b6a19a74887ba", + "shasum": "" + }, + "require": { + "php": "^5.3.2 || ^7.0 || ^8.0", + "psr/log": "^1.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || 6.5 - 8" + }, + "type": "library", + "autoload": { + "psr-4": { + "Composer\\XdebugHandler\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "John Stevenson", + "email": "john-stevenson@blueyonder.co.uk" + } + ], + "description": "Restarts a process without Xdebug.", + "keywords": [ + "Xdebug", + "performance" + ], + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2020-10-24T12:39:10+00:00" + }, + { + "name": "dnoegel/php-xdg-base-dir", + "version": "v0.1.1", + "source": { + "type": "git", + "url": "https://github.com/dnoegel/php-xdg-base-dir.git", + "reference": "8f8a6e48c5ecb0f991c2fdcf5f154a47d85f9ffd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/dnoegel/php-xdg-base-dir/zipball/8f8a6e48c5ecb0f991c2fdcf5f154a47d85f9ffd", + "reference": "8f8a6e48c5ecb0f991c2fdcf5f154a47d85f9ffd", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "require-dev": { + "phpunit/phpunit": "~7.0|~6.0|~5.0|~4.8.35" + }, + "type": "library", + "autoload": { + "psr-4": { + "XdgBaseDir\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "implementation of xdg base directory specification for php", + "time": "2019-12-04T15:06:13+00:00" + }, { "name": "doctrine/instantiator", "version": "dev-master", @@ -1712,6 +2107,99 @@ ], "time": "2020-06-15T18:51:04+00:00" }, + { + "name": "felixfbecker/advanced-json-rpc", + "version": "v3.1.1", + "source": { + "type": "git", + "url": "https://github.com/felixfbecker/php-advanced-json-rpc.git", + "reference": "0ed363f8de17d284d479ec813c9ad3f6834b5c40" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/felixfbecker/php-advanced-json-rpc/zipball/0ed363f8de17d284d479ec813c9ad3f6834b5c40", + "reference": "0ed363f8de17d284d479ec813c9ad3f6834b5c40", + "shasum": "" + }, + "require": { + "netresearch/jsonmapper": "^1.0 || ^2.0", + "php": ">=7.0", + "phpdocumentor/reflection-docblock": "^4.0.0 || ^5.0.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "AdvancedJsonRpc\\": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "ISC" + ], + "authors": [ + { + "name": "Felix Becker", + "email": "felix.b@outlook.com" + } + ], + "description": "A more advanced JSONRPC implementation", + "time": "2020-03-11T15:21:41+00:00" + }, + { + "name": "felixfbecker/language-server-protocol", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/felixfbecker/php-language-server-protocol.git", + "reference": "85e83cacd2ed573238678c6875f8f0d7ec699541" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/felixfbecker/php-language-server-protocol/zipball/85e83cacd2ed573238678c6875f8f0d7ec699541", + "reference": "85e83cacd2ed573238678c6875f8f0d7ec699541", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "require-dev": { + "phpstan/phpstan": "*", + "squizlabs/php_codesniffer": "^3.1", + "vimeo/psalm": "^4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "LanguageServerProtocol\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "ISC" + ], + "authors": [ + { + "name": "Felix Becker", + "email": "felix.b@outlook.com" + } + ], + "description": "PHP classes for the Language Server Protocol", + "keywords": [ + "language", + "microsoft", + "php", + "server" + ], + "time": "2020-10-23T13:55:30+00:00" + }, { "name": "matthiasmullie/minify", "version": "1.3.63", @@ -1875,6 +2363,52 @@ ], "time": "2020-10-01T09:35:15+00:00" }, + { + "name": "netresearch/jsonmapper", + "version": "v2.1.0", + "source": { + "type": "git", + "url": "https://github.com/cweiske/jsonmapper.git", + "reference": "e0f1e33a71587aca81be5cffbb9746510e1fe04e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/cweiske/jsonmapper/zipball/e0f1e33a71587aca81be5cffbb9746510e1fe04e", + "reference": "e0f1e33a71587aca81be5cffbb9746510e1fe04e", + "shasum": "" + }, + "require": { + "ext-json": "*", + "ext-pcre": "*", + "ext-reflection": "*", + "ext-spl": "*", + "php": ">=5.6" + }, + "require-dev": { + "phpunit/phpunit": "~4.8.35 || ~5.7 || ~6.4 || ~7.0", + "squizlabs/php_codesniffer": "~3.5" + }, + "type": "library", + "autoload": { + "psr-0": { + "JsonMapper": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "OSL-3.0" + ], + "authors": [ + { + "name": "Christian Weiske", + "email": "cweiske@cweiske.de", + "homepage": "http://github.com/cweiske/jsonmapper/", + "role": "Developer" + } + ], + "description": "Map nested JSON structures onto PHP classes", + "time": "2020-04-16T18:48:43+00:00" + }, { "name": "nikic/php-parser", "version": "v4.10.2", @@ -1927,6 +2461,55 @@ ], "time": "2020-09-26T10:30:38+00:00" }, + { + "name": "openlss/lib-array2xml", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/nullivex/lib-array2xml.git", + "reference": "a91f18a8dfc69ffabe5f9b068bc39bb202c81d90" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nullivex/lib-array2xml/zipball/a91f18a8dfc69ffabe5f9b068bc39bb202c81d90", + "reference": "a91f18a8dfc69ffabe5f9b068bc39bb202c81d90", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "type": "library", + "autoload": { + "psr-0": { + "LSS": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Bryan Tong", + "email": "bryan@nullivex.com", + "homepage": "https://www.nullivex.com" + }, + { + "name": "Tony Butler", + "email": "spudz76@gmail.com", + "homepage": "https://www.nullivex.com" + } + ], + "description": "Array2XML conversion library credit to lalit.org", + "homepage": "https://www.nullivex.com", + "keywords": [ + "array", + "array conversion", + "xml", + "xml conversion" + ], + "time": "2019-03-29T20:06:56+00:00" + }, { "name": "phar-io/manifest", "version": "dev-master", @@ -2245,12 +2828,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "709a404472c4aabdf54c64d5ce98c6f3113f6bb4" + "reference": "ed363c3ce393560a1c300dce0298bbf0f0528b13" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/709a404472c4aabdf54c64d5ce98c6f3113f6bb4", - "reference": "709a404472c4aabdf54c64d5ce98c6f3113f6bb4", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/ed363c3ce393560a1c300dce0298bbf0f0528b13", + "reference": "ed363c3ce393560a1c300dce0298bbf0f0528b13", "shasum": "" }, "require": { @@ -2310,7 +2893,7 @@ "type": "github" } ], - "time": "2020-10-25T04:48:50+00:00" + "time": "2020-10-26T15:46:21+00:00" }, { "name": "phpunit/php-file-iterator", @@ -2318,12 +2901,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "9261b419918657b8414f50bad5dd7259ab883144" + "reference": "86daa943fbb765aa0129d16f84c5bf7aaec44582" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/9261b419918657b8414f50bad5dd7259ab883144", - "reference": "9261b419918657b8414f50bad5dd7259ab883144", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/86daa943fbb765aa0129d16f84c5bf7aaec44582", + "reference": "86daa943fbb765aa0129d16f84c5bf7aaec44582", "shasum": "" }, "require": { @@ -2366,7 +2949,7 @@ "type": "github" } ], - "time": "2020-10-25T04:50:35+00:00" + "time": "2020-10-26T04:57:30+00:00" }, { "name": "phpunit/php-invoker", @@ -2374,12 +2957,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-invoker.git", - "reference": "4438206001579af6dd8cb5fde02ff6d1a7b56b83" + "reference": "dd5300fef2ede06687642585706f912c073a0cc5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/4438206001579af6dd8cb5fde02ff6d1a7b56b83", - "reference": "4438206001579af6dd8cb5fde02ff6d1a7b56b83", + "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/dd5300fef2ede06687642585706f912c073a0cc5", + "reference": "dd5300fef2ede06687642585706f912c073a0cc5", "shasum": "" }, "require": { @@ -2425,7 +3008,7 @@ "type": "github" } ], - "time": "2020-10-25T04:50:46+00:00" + "time": "2020-10-26T04:57:38+00:00" }, { "name": "phpunit/php-text-template", @@ -2433,12 +3016,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "da49b59805800de599d36c873d06d968212d4833" + "reference": "60c51e16ad53fc17844f6fd6e608e80d9743f320" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/da49b59805800de599d36c873d06d968212d4833", - "reference": "da49b59805800de599d36c873d06d968212d4833", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/60c51e16ad53fc17844f6fd6e608e80d9743f320", + "reference": "60c51e16ad53fc17844f6fd6e608e80d9743f320", "shasum": "" }, "require": { @@ -2480,7 +3063,7 @@ "type": "github" } ], - "time": "2020-10-25T04:51:25+00:00" + "time": "2020-10-26T05:38:01+00:00" }, { "name": "phpunit/php-timer", @@ -2488,12 +3071,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "ef5018a5d81904ae1a8b5d998f1d16138b86aa42" + "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/ef5018a5d81904ae1a8b5d998f1d16138b86aa42", - "reference": "ef5018a5d81904ae1a8b5d998f1d16138b86aa42", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", + "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", "shasum": "" }, "require": { @@ -2535,7 +3118,7 @@ "type": "github" } ], - "time": "2020-10-25T04:50:56+00:00" + "time": "2020-10-26T13:16:10+00:00" }, { "name": "phpunit/phpunit", @@ -2543,12 +3126,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "bf6442de9f2867600e30acc538803a5911237f72" + "reference": "d3b55c36f95329c062e69f6c10441106cf712f7f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/bf6442de9f2867600e30acc538803a5911237f72", - "reference": "bf6442de9f2867600e30acc538803a5911237f72", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/d3b55c36f95329c062e69f6c10441106cf712f7f", + "reference": "d3b55c36f95329c062e69f6c10441106cf712f7f", "shasum": "" }, "require": { @@ -2634,7 +3217,56 @@ "type": "github" } ], - "time": "2020-10-25T04:47:12+00:00" + "time": "2020-10-26T06:27:31+00:00" + }, + { + "name": "psr/container", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "381524e8568e07f31d504a945b88556548c8c42e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/381524e8568e07f31d504a945b88556548c8c42e", + "reference": "381524e8568e07f31d504a945b88556548c8c42e", + "shasum": "" + }, + "require": { + "php": ">=7.2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1.x-dev" + } + }, + "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" + ], + "time": "2020-10-13T07:07:53+00:00" }, { "name": "sebastian/cli-parser", @@ -2642,12 +3274,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/cli-parser.git", - "reference": "20af41a47fef3a828e400b9fa65a9e70014821fa" + "reference": "bb3529e836d10bd4d2713ae050a2c5251eb9ff3e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/20af41a47fef3a828e400b9fa65a9e70014821fa", - "reference": "20af41a47fef3a828e400b9fa65a9e70014821fa", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/bb3529e836d10bd4d2713ae050a2c5251eb9ff3e", + "reference": "bb3529e836d10bd4d2713ae050a2c5251eb9ff3e", "shasum": "" }, "require": { @@ -2686,7 +3318,7 @@ "type": "github" } ], - "time": "2020-10-25T04:59:31+00:00" + "time": "2020-10-26T04:58:42+00:00" }, { "name": "sebastian/code-unit", @@ -2694,12 +3326,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/code-unit.git", - "reference": "f18e2644f5c453eb800569ad19d829c50a5c231a" + "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/f18e2644f5c453eb800569ad19d829c50a5c231a", - "reference": "f18e2644f5c453eb800569ad19d829c50a5c231a", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/1fc9f64c0927627ef78ba436c9b17d967e68e120", + "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120", "shasum": "" }, "require": { @@ -2738,7 +3370,7 @@ "type": "github" } ], - "time": "2020-10-25T04:49:06+00:00" + "time": "2020-10-26T13:08:54+00:00" }, { "name": "sebastian/code-unit-reverse-lookup", @@ -2746,12 +3378,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", - "reference": "c46c6a70d436c927b8a7c4a22b93219e0a57f116" + "reference": "aed227b805d6b8d279d05cee266b46f5512b8ea4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/c46c6a70d436c927b8a7c4a22b93219e0a57f116", - "reference": "c46c6a70d436c927b8a7c4a22b93219e0a57f116", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/aed227b805d6b8d279d05cee266b46f5512b8ea4", + "reference": "aed227b805d6b8d279d05cee266b46f5512b8ea4", "shasum": "" }, "require": { @@ -2789,7 +3421,7 @@ "type": "github" } ], - "time": "2020-10-25T04:49:16+00:00" + "time": "2020-10-26T04:56:19+00:00" }, { "name": "sebastian/comparator", @@ -2797,12 +3429,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "1374f447d5707d2d1e690c6400c3034973007b1d" + "reference": "55f4261989e546dc112258c7a75935a81a7ce382" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/1374f447d5707d2d1e690c6400c3034973007b1d", - "reference": "1374f447d5707d2d1e690c6400c3034973007b1d", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/55f4261989e546dc112258c7a75935a81a7ce382", + "reference": "55f4261989e546dc112258c7a75935a81a7ce382", "shasum": "" }, "require": { @@ -2859,7 +3491,7 @@ "type": "github" } ], - "time": "2020-10-25T04:49:26+00:00" + "time": "2020-10-26T15:49:45+00:00" }, { "name": "sebastian/complexity", @@ -2867,12 +3499,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/complexity.git", - "reference": "6536228719815a632cf51b28d0871fc2aa3b79c5" + "reference": "739b35e53379900cc9ac327b2147867b8b6efd88" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/6536228719815a632cf51b28d0871fc2aa3b79c5", - "reference": "6536228719815a632cf51b28d0871fc2aa3b79c5", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/739b35e53379900cc9ac327b2147867b8b6efd88", + "reference": "739b35e53379900cc9ac327b2147867b8b6efd88", "shasum": "" }, "require": { @@ -2912,7 +3544,7 @@ "type": "github" } ], - "time": "2020-10-25T04:51:35+00:00" + "time": "2020-10-26T15:52:27+00:00" }, { "name": "sebastian/diff", @@ -2920,12 +3552,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "531bfd6f8d3deb09cf51f7a3f628ea6e1e8c8c03" + "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/531bfd6f8d3deb09cf51f7a3f628ea6e1e8c8c03", - "reference": "531bfd6f8d3deb09cf51f7a3f628ea6e1e8c8c03", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/3461e3fccc7cfdfc2720be910d3bd73c69be590d", + "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d", "shasum": "" }, "require": { @@ -2974,7 +3606,7 @@ "type": "github" } ], - "time": "2020-10-25T04:49:36+00:00" + "time": "2020-10-26T13:10:38+00:00" }, { "name": "sebastian/environment", @@ -2982,12 +3614,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "6e46ab7acfa9793f848ea444355ad8407508b604" + "reference": "621594614bd6158ea0c1d6af09c6e5af01d8b1e8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/6e46ab7acfa9793f848ea444355ad8407508b604", - "reference": "6e46ab7acfa9793f848ea444355ad8407508b604", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/621594614bd6158ea0c1d6af09c6e5af01d8b1e8", + "reference": "621594614bd6158ea0c1d6af09c6e5af01d8b1e8", "shasum": "" }, "require": { @@ -3033,7 +3665,7 @@ "type": "github" } ], - "time": "2020-10-25T04:49:45+00:00" + "time": "2020-10-26T04:56:46+00:00" }, { "name": "sebastian/exporter", @@ -3041,12 +3673,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "fcfea176bfa64c9b76e9e326754fddcff97c0b91" + "reference": "1c85999374d0f9e8c7c11ff1e93d0c75343eba8e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/fcfea176bfa64c9b76e9e326754fddcff97c0b91", - "reference": "fcfea176bfa64c9b76e9e326754fddcff97c0b91", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/1c85999374d0f9e8c7c11ff1e93d0c75343eba8e", + "reference": "1c85999374d0f9e8c7c11ff1e93d0c75343eba8e", "shasum": "" }, "require": { @@ -3106,7 +3738,7 @@ "type": "github" } ], - "time": "2020-10-25T04:49:55+00:00" + "time": "2020-10-26T04:56:54+00:00" }, { "name": "sebastian/global-state", @@ -3114,12 +3746,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "baec50db0ae2a69ecc95381249d04410da1f408d" + "reference": "a90ccbddffa067b51f574dea6eb25d5680839455" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/baec50db0ae2a69ecc95381249d04410da1f408d", - "reference": "baec50db0ae2a69ecc95381249d04410da1f408d", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/a90ccbddffa067b51f574dea6eb25d5680839455", + "reference": "a90ccbddffa067b51f574dea6eb25d5680839455", "shasum": "" }, "require": { @@ -3166,7 +3798,7 @@ "type": "github" } ], - "time": "2020-10-25T04:50:06+00:00" + "time": "2020-10-26T15:55:19+00:00" }, { "name": "sebastian/lines-of-code", @@ -3174,12 +3806,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/lines-of-code.git", - "reference": "a1c2dd0ac77460dde453c7d50a51feca4d7eec97" + "reference": "acf76492a65401babcf5283296fa510782783a7a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/a1c2dd0ac77460dde453c7d50a51feca4d7eec97", - "reference": "a1c2dd0ac77460dde453c7d50a51feca4d7eec97", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/acf76492a65401babcf5283296fa510782783a7a", + "reference": "acf76492a65401babcf5283296fa510782783a7a", "shasum": "" }, "require": { @@ -3219,7 +3851,7 @@ "type": "github" } ], - "time": "2020-10-25T04:51:46+00:00" + "time": "2020-10-26T17:03:56+00:00" }, { "name": "sebastian/object-enumerator", @@ -3227,12 +3859,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "fb188a20279fcdb1e31646765f477f6909d2425d" + "reference": "5c9eeac41b290a3712d88851518825ad78f45c71" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/fb188a20279fcdb1e31646765f477f6909d2425d", - "reference": "fb188a20279fcdb1e31646765f477f6909d2425d", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/5c9eeac41b290a3712d88851518825ad78f45c71", + "reference": "5c9eeac41b290a3712d88851518825ad78f45c71", "shasum": "" }, "require": { @@ -3272,7 +3904,7 @@ "type": "github" } ], - "time": "2020-10-25T04:50:16+00:00" + "time": "2020-10-26T13:12:34+00:00" }, { "name": "sebastian/object-reflector", @@ -3280,12 +3912,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-reflector.git", - "reference": "243921e7a4a5d7123446151debe9d2c5dbe51001" + "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/243921e7a4a5d7123446151debe9d2c5dbe51001", - "reference": "243921e7a4a5d7123446151debe9d2c5dbe51001", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", + "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", "shasum": "" }, "require": { @@ -3323,7 +3955,7 @@ "type": "github" } ], - "time": "2020-10-25T04:50:26+00:00" + "time": "2020-10-26T13:14:26+00:00" }, { "name": "sebastian/recursion-context", @@ -3331,12 +3963,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "8853f5bc9d57f00f3eeec81d21844766d1ab3d64" + "reference": "be9bb5ea038598dd67ac9d40c5c37205d73deff9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/8853f5bc9d57f00f3eeec81d21844766d1ab3d64", - "reference": "8853f5bc9d57f00f3eeec81d21844766d1ab3d64", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/be9bb5ea038598dd67ac9d40c5c37205d73deff9", + "reference": "be9bb5ea038598dd67ac9d40c5c37205d73deff9", "shasum": "" }, "require": { @@ -3382,7 +4014,7 @@ "type": "github" } ], - "time": "2020-10-25T04:51:06+00:00" + "time": "2020-10-26T13:20:23+00:00" }, { "name": "sebastian/resource-operations", @@ -3441,12 +4073,12 @@ "source": { "type": "git", "url": "https://github.com/sebastianbergmann/type.git", - "reference": "1680f27f4bb5977f9be4fb25c21bd89e2cf91792" + "reference": "81cd61ab7bbf2de744aba0ea61fae32f721df3d2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/1680f27f4bb5977f9be4fb25c21bd89e2cf91792", - "reference": "1680f27f4bb5977f9be4fb25c21bd89e2cf91792", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/81cd61ab7bbf2de744aba0ea61fae32f721df3d2", + "reference": "81cd61ab7bbf2de744aba0ea61fae32f721df3d2", "shasum": "" }, "require": { @@ -3485,7 +4117,7 @@ "type": "github" } ], - "time": "2020-10-25T04:51:16+00:00" + "time": "2020-10-26T13:18:59+00:00" }, { "name": "sebastian/version", @@ -3570,18 +4202,112 @@ "description": "IDE help files for Swoole.", "time": "2020-09-16T00:12:52+00:00" }, + { + "name": "symfony/console", + "version": "5.x-dev", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "4f00061f0fe49fb7c836fc31d66f365d8bff32fa" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/4f00061f0fe49fb7c836fc31d66f365d8bff32fa", + "reference": "4f00061f0fe49fb7c836fc31d66f365d8bff32fa", + "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": "Symfony Console Component", + "homepage": "https://symfony.com", + "keywords": [ + "cli", + "command line", + "console", + "terminal" + ], + "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-10-24T12:08:07+00:00" + }, { "name": "symfony/polyfill-ctype", "version": "dev-main", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "f4ba089a5b6366e453971d3aad5fe8e897b37f41" + "reference": "fade6deebd931cfd7a544f68479405a6a08979a3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/f4ba089a5b6366e453971d3aad5fe8e897b37f41", - "reference": "f4ba089a5b6366e453971d3aad5fe8e897b37f41", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/fade6deebd931cfd7a544f68479405a6a08979a3", + "reference": "fade6deebd931cfd7a544f68479405a6a08979a3", "shasum": "" }, "require": { @@ -3593,7 +4319,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.20-dev" + "dev-main": "1.21-dev" }, "thanks": { "name": "symfony/polyfill", @@ -3644,7 +4370,166 @@ "type": "tidelift" } ], - "time": "2020-10-23T14:02:19+00:00" + "time": "2020-10-26T13:35:45+00:00" + }, + { + "name": "symfony/polyfill-intl-grapheme", + "version": "dev-main", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-grapheme.git", + "reference": "ee2f954ea0f9ab61dad0170eddc919ee83bef327" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/ee2f954ea0f9ab61dad0170eddc919ee83bef327", + "reference": "ee2f954ea0f9ab61dad0170eddc919ee83bef327", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.21-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" + ], + "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-10-26T13:35:45+00:00" + }, + { + "name": "symfony/polyfill-intl-normalizer", + "version": "dev-main", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-normalizer.git", + "reference": "69609f9f06790591b4b13a45ee117e7bab6395aa" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/69609f9f06790591b4b13a45ee117e7bab6395aa", + "reference": "69609f9f06790591b4b13a45ee117e7bab6395aa", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.21-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" + ], + "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-10-26T13:35:45+00:00" }, { "name": "symfony/polyfill-mbstring", @@ -3652,12 +4537,12 @@ "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "39d483bdf39be819deabf04ec872eb0b2410b531" + "reference": "401c9d9d3400c53a8f1a39425f0543406c137a43" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/39d483bdf39be819deabf04ec872eb0b2410b531", - "reference": "39d483bdf39be819deabf04ec872eb0b2410b531", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/401c9d9d3400c53a8f1a39425f0543406c137a43", + "reference": "401c9d9d3400c53a8f1a39425f0543406c137a43", "shasum": "" }, "require": { @@ -3669,7 +4554,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.20-dev" + "dev-main": "1.21-dev" }, "thanks": { "name": "symfony/polyfill", @@ -3721,7 +4606,320 @@ "type": "tidelift" } ], - "time": "2020-10-23T14:02:19+00:00" + "time": "2020-10-26T13:35:45+00:00" + }, + { + "name": "symfony/polyfill-php73", + "version": "dev-main", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php73.git", + "reference": "8c0d39c1526009b97f43beea4cc685bbc353a70b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/8c0d39c1526009b97f43beea4cc685bbc353a70b", + "reference": "8c0d39c1526009b97f43beea4cc685bbc353a70b", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.21-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" + ], + "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-10-26T13:35:45+00:00" + }, + { + "name": "symfony/polyfill-php80", + "version": "dev-main", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "3a11f3dfb34ad50f978cb2b8cf936933b87739aa" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/3a11f3dfb34ad50f978cb2b8cf936933b87739aa", + "reference": "3a11f3dfb34ad50f978cb2b8cf936933b87739aa", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.21-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" + ], + "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-10-26T13:35:45+00:00" + }, + { + "name": "symfony/service-contracts", + "version": "dev-main", + "source": { + "type": "git", + "url": "https://github.com/symfony/service-contracts.git", + "reference": "0aeee2f70f4550e6c48c9a796d98f5ceda58dfda" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/0aeee2f70f4550e6c48c9a796d98f5ceda58dfda", + "reference": "0aeee2f70f4550e6c48c9a796d98f5ceda58dfda", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "psr/container": "^1.0" + }, + "suggest": { + "symfony/service-implementation": "" + }, + "type": "library", + "extra": { + "branch-version": "2.3", + "branch-alias": { + "dev-main": "2.3-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" + ], + "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-10-14T17:08:19+00:00" + }, + { + "name": "symfony/string", + "version": "5.x-dev", + "source": { + "type": "git", + "url": "https://github.com/symfony/string.git", + "reference": "40e975edadd4e32cd16f3753b3bad65d9ac48242" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/string/zipball/40e975edadd4e32cd16f3753b3bad65d9ac48242", + "reference": "40e975edadd4e32cd16f3753b3bad65d9ac48242", + "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": "Symfony String component", + "homepage": "https://symfony.com", + "keywords": [ + "grapheme", + "i18n", + "string", + "unicode", + "utf-8", + "utf8" + ], + "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-10-24T12:08:07+00:00" }, { "name": "theseer/tokenizer", @@ -3844,6 +5042,107 @@ ], "time": "2020-10-21T12:45:52+00:00" }, + { + "name": "vimeo/psalm", + "version": "4.0.1", + "source": { + "type": "git", + "url": "https://github.com/vimeo/psalm.git", + "reference": "b1e2e30026936ef8d5bf6a354d1c3959b6231f44" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/vimeo/psalm/zipball/b1e2e30026936ef8d5bf6a354d1c3959b6231f44", + "reference": "b1e2e30026936ef8d5bf6a354d1c3959b6231f44", + "shasum": "" + }, + "require": { + "amphp/amp": "^2.1", + "amphp/byte-stream": "^1.5", + "composer/package-versions-deprecated": "^1.8.0", + "composer/semver": "^1.4 || ^2.0 || ^3.0", + "composer/xdebug-handler": "^1.1", + "dnoegel/php-xdg-base-dir": "^0.1.1", + "ext-dom": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-simplexml": "*", + "ext-tokenizer": "*", + "felixfbecker/advanced-json-rpc": "^3.0.3", + "felixfbecker/language-server-protocol": "^1.4", + "netresearch/jsonmapper": "^1.0 || ^2.0 || ^3.0", + "nikic/php-parser": "^4.10.1", + "openlss/lib-array2xml": "^1.0", + "php": "^7.3|^8", + "sebastian/diff": "^3.0 || ^4.0", + "symfony/console": "^3.4.17 || ^4.1.6 || ^5.0", + "webmozart/glob": "^4.1", + "webmozart/path-util": "^2.3" + }, + "provide": { + "psalm/psalm": "self.version" + }, + "require-dev": { + "amphp/amp": "^2.4.2", + "bamarni/composer-bin-plugin": "^1.2", + "brianium/paratest": "^4.0.0", + "ext-curl": "*", + "phpdocumentor/reflection-docblock": "^5", + "phpmyadmin/sql-parser": "5.1.0", + "phpspec/prophecy": ">=1.9.0", + "phpunit/phpunit": "^9.0", + "psalm/plugin-phpunit": "^0.13", + "slevomat/coding-standard": "^5.0", + "squizlabs/php_codesniffer": "^3.5", + "symfony/process": "^4.3", + "weirdan/prophecy-shim": "^1.0 || ^2.0" + }, + "suggest": { + "ext-igbinary": "^2.0.5" + }, + "bin": [ + "psalm", + "psalm-language-server", + "psalm-plugin", + "psalm-refactor", + "psalter" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.x-dev", + "dev-3.x": "3.x-dev", + "dev-2.x": "2.x-dev", + "dev-1.x": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psalm\\": "src/Psalm/" + }, + "files": [ + "src/functions.php", + "src/spl_object_id.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Matthew Brown" + } + ], + "description": "A static analysis tool for finding errors in PHP applications", + "keywords": [ + "code", + "inspection", + "php" + ], + "time": "2020-10-20T13:40:17+00:00" + }, { "name": "webmozart/assert", "version": "1.9.1", @@ -3892,6 +5191,99 @@ "validate" ], "time": "2020-07-08T17:02:28+00:00" + }, + { + "name": "webmozart/glob", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/webmozart/glob.git", + "reference": "8da14867b709e8776d9f6272faaf844aefc695e3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozart/glob/zipball/8da14867b709e8776d9f6272faaf844aefc695e3", + "reference": "8da14867b709e8776d9f6272faaf844aefc695e3", + "shasum": "" + }, + "require": { + "php": "^5.3.3|^7.0", + "webmozart/path-util": "^2.2" + }, + "require-dev": { + "phpunit/phpunit": "^4.6", + "sebastian/version": "^1.0.1", + "symfony/filesystem": "^2.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.1-dev" + } + }, + "autoload": { + "psr-4": { + "Webmozart\\Glob\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "A PHP implementation of Ant's glob.", + "time": "2016-08-15T15:31:26+00:00" + }, + { + "name": "webmozart/path-util", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/webmozart/path-util.git", + "reference": "95a8f7ad150c2a3773ff3c3d04f557a24c99cfd2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozart/path-util/zipball/95a8f7ad150c2a3773ff3c3d04f557a24c99cfd2", + "reference": "95a8f7ad150c2a3773ff3c3d04f557a24c99cfd2", + "shasum": "" + }, + "require": { + "php": "^5.3.3|^7.0", + "webmozart/assert": "~1.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.6", + "sebastian/version": "^1.0.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3-dev" + } + }, + "autoload": { + "psr-4": { + "Webmozart\\PathUtil\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "A robust cross-platform utility for normalizing, comparing and modifying file paths.", + "time": "2016-08-15T15:31:42+00:00" } ], "aliases": [], diff --git a/docker-compose.yml b/docker-compose.yml index e595a6c37..62574c719 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -52,6 +52,7 @@ services: - appwrite-certificates:/storage/certificates:rw - appwrite-functions:/storage/functions:rw - ./phpunit.xml:/usr/src/code/phpunit.xml + - ./psalm.xml:/usr/src/code/psalm.xml - ./tests:/usr/src/code/tests - ./app:/usr/src/code/app # - ./vendor:/usr/src/code/vendor diff --git a/psalm.xml b/psalm.xml new file mode 100644 index 000000000..30258a709 --- /dev/null +++ b/psalm.xml @@ -0,0 +1,15 @@ + + + + + + + + + diff --git a/src/Appwrite/Auth/Auth.php b/src/Appwrite/Auth/Auth.php index 634b456c7..0aebac7c5 100644 --- a/src/Appwrite/Auth/Auth.php +++ b/src/Appwrite/Auth/Auth.php @@ -118,7 +118,7 @@ class Auth * * @return string */ - public static function hash($string) + public static function hash(string $string) { return \hash('sha256', $string); } @@ -130,7 +130,7 @@ class Auth * * @param $string * - * @return bool|string + * @return bool|string|null */ public static function passwordHash($string) { @@ -193,14 +193,14 @@ class Auth */ public static function tokenVerify(array $tokens, int $type, string $secret) { - foreach ($tokens as $token) { /* @var $token Document */ - if (isset($token['type']) && - isset($token['secret']) && - isset($token['expire']) && - $token['type'] == $type && - $token['secret'] === self::hash($secret) && - $token['expire'] >= \time()) { - return $token->getId(); + foreach ($tokens as $token) { /** @var Document $token */ + if ($token->isSet('type') && + $token->isSet('secret') && + $token->isSet('expire') && + $token->getAttribute('type') == $type && + $token->getAttribute('secret') === self::hash($secret) && + $token->getAttribute('expire') >= \time()) { + return (string)$token->getId(); } } diff --git a/src/Appwrite/Auth/OAuth2.php b/src/Appwrite/Auth/OAuth2.php index 5a92049fc..afc887802 100644 --- a/src/Appwrite/Auth/OAuth2.php +++ b/src/Appwrite/Auth/OAuth2.php @@ -20,7 +20,7 @@ abstract class OAuth2 protected $callback; /** - * @var string + * @var array */ protected $state; @@ -38,7 +38,7 @@ abstract class OAuth2 * @param array $state * @param array $scopes */ - public function __construct(string $appId, string $appSecret, string $callback, $state = [], $scopes = []) + public function __construct(string $appId, string $appSecret, string $callback, array $state = [], array $scopes = []) { $this->appID = $appId; $this->appSecret = $appSecret; @@ -116,7 +116,7 @@ abstract class OAuth2 /** * @param $state * - * @return string + * @return array */ public function parseState(string $state) { @@ -152,6 +152,6 @@ abstract class OAuth2 \curl_close($ch); - return $response; + return (string)$response; } } diff --git a/src/Appwrite/Auth/OAuth2/Amazon.php b/src/Appwrite/Auth/OAuth2/Amazon.php index eb7433c1c..de5dde8e4 100644 --- a/src/Appwrite/Auth/OAuth2/Amazon.php +++ b/src/Appwrite/Auth/OAuth2/Amazon.php @@ -34,7 +34,7 @@ class Amazon extends OAuth2 /** * @param $state * - * @return json + * @return array */ public function parseState(string $state) { @@ -63,7 +63,7 @@ class Amazon extends OAuth2 */ public function getAccessToken(string $code): string { - $headers[] = 'Content-Type: application/x-www-form-urlencoded;charset=UTF-8'; + $headers = ['Content-Type: application/x-www-form-urlencoded;charset=UTF-8']; $accessToken = $this->request( 'POST', 'https://api.amazon.com/auth/o2/token', @@ -76,6 +76,7 @@ class Amazon extends OAuth2 'grant_type' => 'authorization_code' ]) ); + $accessToken = \json_decode($accessToken, true); if (isset($accessToken['access_token'])) { diff --git a/src/Appwrite/Auth/OAuth2/Apple.php b/src/Appwrite/Auth/OAuth2/Apple.php index 11a0b0c69..b0ecbd82f 100644 --- a/src/Appwrite/Auth/OAuth2/Apple.php +++ b/src/Appwrite/Auth/OAuth2/Apple.php @@ -58,7 +58,7 @@ class Apple extends OAuth2 */ public function getAccessToken(string $code): string { - $headers[] = 'Content-Type: application/x-www-form-urlencoded'; + $headers = ['Content-Type: application/x-www-form-urlencoded']; $accessToken = $this->request( 'POST', 'https://appleid.apple.com/auth/token', @@ -175,8 +175,10 @@ class Apple extends OAuth2 /** * @param string $data + * + * @return string */ - protected function encode($data) + protected function encode($data): string { return \str_replace(['+', '/', '='], ['-', '_', ''], \base64_encode($data)); } diff --git a/src/Appwrite/Auth/OAuth2/Bitbucket.php b/src/Appwrite/Auth/OAuth2/Bitbucket.php index ff867cbe6..651aed7f8 100644 --- a/src/Appwrite/Auth/OAuth2/Bitbucket.php +++ b/src/Appwrite/Auth/OAuth2/Bitbucket.php @@ -48,7 +48,7 @@ class Bitbucket extends OAuth2 public function getAccessToken(string $code): string { // Required as per Bitbucket Spec. - $headers[] = 'Content-Type: application/x-www-form-urlencoded'; + $headers = ['Content-Type: application/x-www-form-urlencoded']; $accessToken = $this->request( 'POST', diff --git a/src/Appwrite/Auth/OAuth2/Discord.php b/src/Appwrite/Auth/OAuth2/Discord.php index 36bc102ca..f28c2a8dd 100644 --- a/src/Appwrite/Auth/OAuth2/Discord.php +++ b/src/Appwrite/Auth/OAuth2/Discord.php @@ -69,7 +69,7 @@ class Discord extends OAuth2 'redirect_uri' => $this->callback, 'client_id' => $this->appID, 'client_secret' => $this->appSecret, - 'scope' => \implode(' ', $this->scope) + 'scope' => \implode(' ', $this->getScopes()) ]) ); diff --git a/src/Appwrite/Auth/OAuth2/Dropbox.php b/src/Appwrite/Auth/OAuth2/Dropbox.php index 85567c77e..31503d1bc 100644 --- a/src/Appwrite/Auth/OAuth2/Dropbox.php +++ b/src/Appwrite/Auth/OAuth2/Dropbox.php @@ -48,7 +48,7 @@ class Dropbox extends OAuth2 */ public function getAccessToken(string $code): string { - $headers[] = 'Content-Type: application/x-www-form-urlencoded'; + $headers = ['Content-Type: application/x-www-form-urlencoded']; $accessToken = $this->request( 'POST', 'https://api.dropboxapi.com/oauth2/token', @@ -127,7 +127,7 @@ class Dropbox extends OAuth2 protected function getUser(string $accessToken): array { if (empty($this->user)) { - $headers[] = 'Authorization: Bearer '. \urlencode($accessToken); + $headers = ['Authorization: Bearer '. \urlencode($accessToken)]; $user = $this->request('POST', 'https://api.dropboxapi.com/2/users/get_current_account', $headers); $this->user = \json_decode($user, true); } diff --git a/src/Appwrite/Auth/OAuth2/Microsoft.php b/src/Appwrite/Auth/OAuth2/Microsoft.php index 349446ead..902719ef8 100644 --- a/src/Appwrite/Auth/OAuth2/Microsoft.php +++ b/src/Appwrite/Auth/OAuth2/Microsoft.php @@ -53,7 +53,7 @@ class Microsoft extends OAuth2 */ public function getAccessToken(string $code): string { - $headers[] = 'Content-Type: application/x-www-form-urlencoded'; + $headers = ['Content-Type: application/x-www-form-urlencoded']; $accessToken = $this->request( 'POST', @@ -134,7 +134,7 @@ class Microsoft extends OAuth2 protected function getUser(string $accessToken): array { if (empty($this->user)) { - $headers[] = 'Authorization: Bearer '. \urlencode($accessToken); + $headers = ['Authorization: Bearer '. \urlencode($accessToken)]; $user = $this->request('GET', 'https://graph.microsoft.com/v1.0/me', $headers); $this->user = \json_decode($user, true); } diff --git a/src/Appwrite/Auth/OAuth2/Paypal.php b/src/Appwrite/Auth/OAuth2/Paypal.php index f7e143c5d..7f431d227 100644 --- a/src/Appwrite/Auth/OAuth2/Paypal.php +++ b/src/Appwrite/Auth/OAuth2/Paypal.php @@ -10,18 +10,24 @@ use Appwrite\Auth\OAuth2; class Paypal extends OAuth2 { /** - * @var string + * @var array */ - private $endpoint= [ + private $endpoint = [ 'sandbox' => 'https://www.sandbox.paypal.com/', 'live' => 'https://www.paypal.com/', ]; + /** + * @var array + */ private $resourceEndpoint = [ 'sandbox' => 'https://api.sandbox.paypal.com/v1/', 'live' => 'https://api.paypal.com/v1/', ]; + /** + * @var string + */ protected $environment = 'live'; /** @@ -29,11 +35,13 @@ class Paypal extends OAuth2 */ protected $user = []; - + /** + * @var array + */ protected $scopes = [ - 'openid', - 'profile', - 'email' + 'openid', + 'profile', + 'email' ]; /** diff --git a/src/Appwrite/Auth/OAuth2/Salesforce.php b/src/Appwrite/Auth/OAuth2/Salesforce.php index 7e6467d33..76256e010 100644 --- a/src/Appwrite/Auth/OAuth2/Salesforce.php +++ b/src/Appwrite/Auth/OAuth2/Salesforce.php @@ -34,7 +34,7 @@ class Salesforce extends OAuth2 /** * @param $state * - * @return json + * @return array */ public function parseState(string $state) { diff --git a/src/Appwrite/Auth/OAuth2/Vk.php b/src/Appwrite/Auth/OAuth2/Vk.php index 11e1fd4f0..bd1d59dad 100644 --- a/src/Appwrite/Auth/OAuth2/Vk.php +++ b/src/Appwrite/Auth/OAuth2/Vk.php @@ -61,7 +61,7 @@ class Vk extends OAuth2 */ public function getAccessToken(string $code): string { - $headers[] = 'Content-Type: application/x-www-form-urlencoded;charset=UTF-8'; + $headers = ['Content-Type: application/x-www-form-urlencoded;charset=UTF-8']; $accessToken = $this->request( 'POST', 'https://oauth.vk.com/access_token?', diff --git a/src/Appwrite/Auth/OAuth2/Yahoo.php b/src/Appwrite/Auth/OAuth2/Yahoo.php index 8593c41ce..1702e6968 100644 --- a/src/Appwrite/Auth/OAuth2/Yahoo.php +++ b/src/Appwrite/Auth/OAuth2/Yahoo.php @@ -45,7 +45,7 @@ class Yahoo extends OAuth2 /** * @param $state * - * @return json + * @return array */ public function parseState(string $state) { diff --git a/src/Appwrite/Auth/OAuth2/Yandex.php b/src/Appwrite/Auth/OAuth2/Yandex.php index 7955d33fd..e6b94677d 100644 --- a/src/Appwrite/Auth/OAuth2/Yandex.php +++ b/src/Appwrite/Auth/OAuth2/Yandex.php @@ -32,7 +32,7 @@ class Yandex extends OAuth2 /** * @param $state * - * @return json + * @return array */ public function parseState(string $state) { diff --git a/src/Appwrite/Database/Adapter.php b/src/Appwrite/Database/Adapter.php index 4dc715257..6e14365f8 100644 --- a/src/Appwrite/Database/Adapter.php +++ b/src/Appwrite/Database/Adapter.php @@ -54,7 +54,7 @@ abstract class Adapter /** * Get Document. * - * @param int $id + * @param string $id * * @return array */ @@ -82,11 +82,11 @@ abstract class Adapter /** * Delete Node. * - * @param int $id + * @param string $id * * @return array */ - abstract public function deleteDocument($id); + abstract public function deleteDocument(string $id); /** * Delete Unique Key. diff --git a/src/Appwrite/Database/Adapter/MySQL.php b/src/Appwrite/Database/Adapter/MySQL.php index dffa39b7b..d361433df 100644 --- a/src/Appwrite/Database/Adapter/MySQL.php +++ b/src/Appwrite/Database/Adapter/MySQL.php @@ -139,7 +139,7 @@ class MySQL extends Adapter { $order = 0; $data = \array_merge(['$id' => null, '$permissions' => []], $data); // Merge data with default params - $signature = \md5(\json_encode($data, true)); + $signature = \md5(\json_encode($data)); $revision = \uniqid('', true); $data['$id'] = (empty($data['$id'])) ? null : $data['$id']; @@ -232,6 +232,10 @@ class MySQL extends Adapter // Handle array of relations if (self::DATA_TYPE_ARRAY === $type) { + if(!is_array($value)) { // Property should be of type array, if not = skip + continue; + } + foreach ($value as $i => $child) { if (self::DATA_TYPE_DICTIONARY !== $this->getDataType($child)) { // not dictionary @@ -315,13 +319,13 @@ class MySQL extends Adapter /** * Delete Document. * - * @param int $id + * @param string $id * * @return array * * @throws Exception */ - public function deleteDocument($id) + public function deleteDocument(string $id) { $st1 = $this->getPDO()->prepare('DELETE FROM `'.$this->getNamespace().'.database.documents` WHERE uid = :id @@ -763,8 +767,10 @@ class MySQL extends Adapter /** * Get Unique Document ID. + * + * @return string */ - public function getId() + public function getId(): string { $unique = \uniqid(); $attempts = 5; @@ -882,12 +888,12 @@ class MySQL extends Adapter } /** - * @param $key - * @param $value + * @param string $key + * @param mixed $value * * @return $this */ - public function setDebug($key, $value) + public function setDebug(string $key, $value): self { $this->debug[$key] = $value; @@ -897,15 +903,17 @@ class MySQL extends Adapter /** * @return array */ - public function getDebug() + public function getDebug(): array { return $this->debug; } /** * return $this;. + * + * @return void */ - public function resetDebug() + public function resetDebug(): void { $this->debug = []; } @@ -915,7 +923,7 @@ class MySQL extends Adapter * * @throws Exception */ - protected function getPDO() + protected function getPDO(): PDO { return $this->register->get('db'); } @@ -925,7 +933,7 @@ class MySQL extends Adapter * * @return Client */ - protected function getRedis():Client + protected function getRedis(): Client { return $this->register->get('cache'); } diff --git a/src/Appwrite/Database/Adapter/Redis.php b/src/Appwrite/Database/Adapter/Redis.php index 7fe6ee068..a1e440112 100644 --- a/src/Appwrite/Database/Adapter/Redis.php +++ b/src/Appwrite/Database/Adapter/Redis.php @@ -137,13 +137,13 @@ class Redis extends Adapter /** * Delete Document. * - * @param $id + * @param string $id * * @return array * * @throws Exception */ - public function deleteDocument($id) + public function deleteDocument(string $id) { $data = $this->adapter->deleteDocument($id); @@ -243,7 +243,7 @@ class Redis extends Adapter */ public function lastModified() { - return; + return 0; } /** @@ -259,7 +259,7 @@ class Redis extends Adapter * * @return Client */ - protected function getRedis():Client + protected function getRedis(): Client { return $this->register->get('cache'); } diff --git a/src/Appwrite/Database/Database.php b/src/Appwrite/Database/Database.php index 4c62307b0..70725a89d 100644 --- a/src/Appwrite/Database/Database.php +++ b/src/Appwrite/Database/Database.php @@ -116,7 +116,7 @@ class Database /** * Create Namespace. * - * @param int $namespace + * @param string $namespace * * @return bool */ @@ -128,7 +128,7 @@ class Database /** * Delete Namespace. * - * @param int $namespace + * @param string $namespace * * @return bool */ @@ -187,22 +187,23 @@ class Database } /** - * @param int $id + * @param string $id * @param bool $mock is mocked data allowed? + * @param bool $decode enable decoding? * * @return Document */ - public function getDocument($id, $mock = true, $decode = true) + public function getDocument($id, bool $mock = true, bool $decode = true) { if (\is_null($id)) { - return new Document([]); + return new Document(); } $document = new Document((isset($this->mocks[$id]) && $mock) ? $this->mocks[$id] : $this->adapter->getDocument($id)); $validator = new Authorization($document, 'read'); if (!$validator->isValid($document->getPermissions())) { // Check if user has read access to this document - return new Document([]); + return new Document(); } $document = ($decode) ? $this->decode($document) : $document; @@ -326,13 +327,13 @@ class Database } /** - * @param int $id + * @param string $id * * @return Document|false * * @throws AuthorizationException */ - public function deleteDocument($id) + public function deleteDocument(string $id) { $document = $this->getDocument($id); @@ -395,9 +396,9 @@ class Database * @param string $key * @param string $value * - * @return array + * @return self */ - public function setMock($key, $value) + public function setMock($key, $value): self { $this->mocks[$key] = $value; @@ -405,11 +406,11 @@ class Database } /** - * @param string $mocks + * @param array $mocks * - * @return array + * @return self */ - public function setMocks(array $mocks) + public function setMocks(array $mocks): self { $this->mocks = $mocks; @@ -426,14 +427,14 @@ class Database /** * Add Attribute Filter - * + * * @param string $name * @param callable $encode * @param callable $decode - * - * return $this + * + * @return void */ - static public function addFilter(string $name, callable $encode, callable $decode) + static public function addFilter(string $name, callable $encode, callable $decode): void { self::$filters[$name] = [ 'encode' => $encode, diff --git a/src/Appwrite/Database/Document.php b/src/Appwrite/Database/Document.php index 2c0ad4131..2a472b839 100644 --- a/src/Appwrite/Database/Document.php +++ b/src/Appwrite/Database/Document.php @@ -17,11 +17,11 @@ class Document extends ArrayObject * * @see ArrayObject::__construct * - * @param null $input + * @param array $input * @param int $flags * @param string $iterator_class */ - public function __construct($input = null, $flags = 0, $iterator_class = 'ArrayIterator') + public function __construct($input = [], $flags = 0, $iterator_class = 'ArrayIterator') { foreach ($input as $key => &$value) { if (\is_array($value)) { @@ -49,7 +49,7 @@ class Document extends ArrayObject } /** - * @return int|null + * @return string */ public function getCollection() { @@ -196,8 +196,8 @@ class Document extends ArrayObject /** * Checks if a document key is set. * - * @param $key - * + * @param string $key + * * @return bool */ public function isSet($key) diff --git a/src/Appwrite/Database/Validator/Authorization.php b/src/Appwrite/Database/Validator/Authorization.php index 2938a3796..03fd40a30 100644 --- a/src/Appwrite/Database/Validator/Authorization.php +++ b/src/Appwrite/Database/Validator/Authorization.php @@ -15,7 +15,7 @@ class Authorization extends Validator /** * @var Document */ - protected $document = null; + protected $document; /** * @var string @@ -56,7 +56,7 @@ class Authorization extends Validator * * Returns true if valid or false if not. * - * @param array $permissions + * @param mixed $permissions * * @return bool */ @@ -89,8 +89,10 @@ class Authorization extends Validator /** * @param string $role + * + * @return void */ - public static function setRole($role) + public static function setRole($role): void { self::$roles[] = $role; } @@ -120,33 +122,41 @@ class Authorization extends Validator * Change default status. * This will be used for the * value set on the self::reset() method + * + * @return void */ - public static function setDefaultStatus($status) + public static function setDefaultStatus($status): void { self::$statusDefault = $status; self::$status = $status; } /** - * Enable Authorization checks + * Enable Authorization checks + * + * @return void */ - public static function enable() + public static function enable(): void { self::$status = true; } /** * Disable Authorization checks + * + * @return void */ - public static function disable() + public static function disable(): void { self::$status = false; } /** * Disable Authorization checks + * + * @return void */ - public static function reset() + public static function reset(): void { self::$status = self::$statusDefault; } diff --git a/src/Appwrite/Database/Validator/Collection.php b/src/Appwrite/Database/Validator/Collection.php index 5f8c81dc8..4941a777e 100644 --- a/src/Appwrite/Database/Validator/Collection.php +++ b/src/Appwrite/Database/Validator/Collection.php @@ -31,7 +31,11 @@ class Collection extends Structure } /** - * @param Document $document + * Is valid. + * + * Returns true if valid or false if not. + * + * @param mixed $document * * @return bool */ diff --git a/src/Appwrite/Database/Validator/DocumentId.php b/src/Appwrite/Database/Validator/DocumentId.php index 56041dc34..ecfdcc562 100644 --- a/src/Appwrite/Database/Validator/DocumentId.php +++ b/src/Appwrite/Database/Validator/DocumentId.php @@ -16,7 +16,7 @@ class DocumentId extends Validator /** * @var Database */ - protected $database = null; + protected $database; /** * @var string diff --git a/src/Appwrite/Database/Validator/Permissions.php b/src/Appwrite/Database/Validator/Permissions.php index 553d8ff2a..4db82d9b0 100644 --- a/src/Appwrite/Database/Validator/Permissions.php +++ b/src/Appwrite/Database/Validator/Permissions.php @@ -15,7 +15,7 @@ class Permissions extends Validator /** * @var Document */ - protected $document = null; + protected $document; /** * Structure constructor. @@ -44,7 +44,7 @@ class Permissions extends Validator * * Returns true if valid or false if not. * - * @param array $value + * @param mixed $value * * @return bool */ diff --git a/src/Appwrite/Database/Validator/Structure.php b/src/Appwrite/Database/Validator/Structure.php index 3a18c4276..34d885039 100644 --- a/src/Appwrite/Database/Validator/Structure.php +++ b/src/Appwrite/Database/Validator/Structure.php @@ -29,9 +29,9 @@ class Structure extends Validator protected $database; /** - * @var int + * @var string */ - protected $id = null; + protected $id = ''; /** * Basic rules to apply on all documents. @@ -118,7 +118,7 @@ class Structure extends Validator * * Returns true if valid or false if not. * - * @param Document $document + * @param mixed $document * * @return bool */ @@ -156,9 +156,14 @@ class Structure extends Validator foreach ($array as $key => $value) { $rule = $collection->search('key', $key, $rules); - $ruleType = (isset($rule['type'])) ? $rule['type'] : ''; - $ruleRequired = (isset($rule['required'])) ? $rule['required'] : true; - $ruleArray = (isset($rule['array'])) ? $rule['array'] : false; + + if(!$rule) { + continue; + } + + $ruleType = $rule['type'] ?? ''; + $ruleRequired = $rule['required'] ?? true; + $ruleArray = $rule['array'] ?? false; $validator = null; switch ($ruleType) { @@ -269,7 +274,14 @@ class Structure extends Validator return true; } - protected function getCollection($id) + /** + * Get Collection + * + * Get Collection by unique ID + * + * @return Document + */ + protected function getCollection($id): Document { return $this->database->getDocument($id); } diff --git a/src/Appwrite/Database/Validator/UID.php b/src/Appwrite/Database/Validator/UID.php index c6a3c1091..a68c3da35 100644 --- a/src/Appwrite/Database/Validator/UID.php +++ b/src/Appwrite/Database/Validator/UID.php @@ -15,7 +15,7 @@ class UID extends Validator */ public function getDescription() { - return 'Validate UUID format'; + return 'Invalid UID format'; } /** @@ -23,12 +23,20 @@ class UID extends Validator * * Returns true if valid or false if not. * - * @param string $value + * @param mixed $value * * @return bool */ public function isValid($value) { + if ($value === 0) { // TODO Deprecate confition when we get the chance. + return true; + } + + if (!is_string($value)) { + return false; + } + if(mb_strlen($value) > 32) { return false; } diff --git a/src/Appwrite/Docker/Compose.php b/src/Appwrite/Docker/Compose.php index d186f9479..e9fb90687 100644 --- a/src/Appwrite/Docker/Compose.php +++ b/src/Appwrite/Docker/Compose.php @@ -28,7 +28,7 @@ class Compose } /** - * @return array + * @return string */ public function getVersion(): string { diff --git a/src/Appwrite/Docker/Compose/Service.php b/src/Appwrite/Docker/Compose/Service.php index dcb4ce737..476e9a40e 100644 --- a/src/Appwrite/Docker/Compose/Service.php +++ b/src/Appwrite/Docker/Compose/Service.php @@ -54,7 +54,7 @@ class Service public function getImageVersion(): string { $image = $this->getImage(); - return substr($image, strpos($image, ':')+1); + return substr($image, ((int)strpos($image, ':'))+1); } /** diff --git a/src/Appwrite/Docker/Env.php b/src/Appwrite/Docker/Env.php index c1f25d5e4..f97f68b00 100644 --- a/src/Appwrite/Docker/Env.php +++ b/src/Appwrite/Docker/Env.php @@ -46,7 +46,7 @@ class Env /** * @param string $key * - * @return mixed|null + * @return string */ public function getVar(string $key): string { diff --git a/src/Appwrite/Extend/PDO.php b/src/Appwrite/Extend/PDO.php index 384fc71be..72f9f37ac 100644 --- a/src/Appwrite/Extend/PDO.php +++ b/src/Appwrite/Extend/PDO.php @@ -59,7 +59,7 @@ class PDO extends PDONative return $this->pdo->quote($string, $parameter_type); } - public function reconnect() + public function reconnect(): PDONative { $this->pdo = new PDONative($this->dsn, $this->username, $this->passwd, $this->options); diff --git a/src/Appwrite/Network/Validator/CNAME.php b/src/Appwrite/Network/Validator/CNAME.php index 54e4987f1..1d299e48c 100644 --- a/src/Appwrite/Network/Validator/CNAME.php +++ b/src/Appwrite/Network/Validator/CNAME.php @@ -7,7 +7,7 @@ use Utopia\Validator; class CNAME extends Validator { /** - * @var int + * @var string */ protected $target; @@ -19,6 +19,9 @@ class CNAME extends Validator $this->target = $target; } + /** + * @return string + */ public function getDescription() { return 'Invalid CNAME record'; @@ -27,19 +30,19 @@ class CNAME extends Validator /** * Check if CNAME record target value matches selected target * - * @param string $domain + * @param mixed $domain * * @return bool */ public function isValid($domain) { - try { - $records = \dns_get_record($domain, DNS_CNAME); - } catch (\Throwable $th) { + if(!is_string($domain)) { return false; } - if (!$records || !\is_array($records)) { + try { + $records = \dns_get_record($domain, DNS_CNAME); + } catch (\Throwable $th) { return false; } diff --git a/src/Appwrite/Network/Validator/Origin.php b/src/Appwrite/Network/Validator/Origin.php index d1368a1c3..62f1608af 100644 --- a/src/Appwrite/Network/Validator/Origin.php +++ b/src/Appwrite/Network/Validator/Origin.php @@ -93,12 +93,16 @@ class Origin extends Validator * Check if Origin has been whiltlisted * for access to the API * - * @param string $origin + * @param mixed $origin * * @return bool */ public function isValid($origin) { + if(!is_string($origin)) { + return false; + } + $scheme = \parse_url($origin, PHP_URL_SCHEME); $host = \parse_url($origin, PHP_URL_HOST); diff --git a/src/Appwrite/OpenSSL/OpenSSL.php b/src/Appwrite/OpenSSL/OpenSSL.php index 24d48e226..aa641ec83 100644 --- a/src/Appwrite/OpenSSL/OpenSSL.php +++ b/src/Appwrite/OpenSSL/OpenSSL.php @@ -53,7 +53,7 @@ class OpenSSL * @param $length * @param null $crypto_strong * - * @return int + * @return false|string */ public static function randomPseudoBytes($length, &$crypto_strong = null) { diff --git a/src/Appwrite/Resize/Resize.php b/src/Appwrite/Resize/Resize.php index 28d345d03..a9257b6e4 100644 --- a/src/Appwrite/Resize/Resize.php +++ b/src/Appwrite/Resize/Resize.php @@ -34,7 +34,7 @@ class Resize * * @return Resize * - * @throws \ImagickException + * @throws \Throwable */ public function crop(int $width, int $height) { @@ -73,7 +73,7 @@ class Resize * * @return Resize * - * @throws \ImagickException + * @throws \Throwable */ public function setBackground($color) { @@ -133,7 +133,7 @@ class Resize case 'webp': try { $this->image->setImageFormat('webp'); - } catch (\ImagickException $th) { + } catch (\Throwable $th) { $signature = $this->image->getImageSignature(); $temp = '/tmp/temp-'.$signature.'.'.\strtolower($this->image->getImageFormat()); $output = '/tmp/output-'.$signature.'.webp'; diff --git a/src/Appwrite/Storage/Device.php b/src/Appwrite/Storage/Device.php index 42774e01f..5beb6060f 100644 --- a/src/Appwrite/Storage/Device.php +++ b/src/Appwrite/Storage/Device.php @@ -13,7 +13,7 @@ abstract class Device * * @return string */ - abstract public function getName():string; + abstract public function getName(): string; /** * Get Description. @@ -22,7 +22,7 @@ abstract class Device * * @return string */ - abstract public function getDescription():string; + abstract public function getDescription(): string; /** * Get Root. @@ -31,7 +31,7 @@ abstract class Device * * @return string */ - abstract public function getRoot():string; + abstract public function getRoot(): string; /** * Get Path. @@ -42,7 +42,7 @@ abstract class Device * * @return string */ - abstract public function getPath($filename):string; + abstract public function getPath($filename): string; /** * Upload. @@ -56,7 +56,7 @@ abstract class Device * * @return bool */ - abstract public function upload($source, $path):bool; + abstract public function upload($source, $path): bool; /** * Read file by given path. @@ -65,7 +65,7 @@ abstract class Device * * @return string */ - abstract public function read(string $path):string; + abstract public function read(string $path): string; /** * Write file by given path. @@ -73,9 +73,9 @@ abstract class Device * @param string $path * @param string $data * - * @return string + * @return bool */ - abstract public function write(string $path, string $data):bool; + abstract public function write(string $path, string $data): bool; /** * Move file from given source to given path, return true on success and false on failure. @@ -87,7 +87,7 @@ abstract class Device * * @return bool */ - abstract public function move(string $source, string $target):bool; + abstract public function move(string $source, string $target): bool; /** * Delete file in given path return true on success and false on failure. @@ -99,7 +99,7 @@ abstract class Device * * @return bool */ - abstract public function delete(string $path, bool $recursive = false):bool; + abstract public function delete(string $path, bool $recursive = false): bool; /** * Returns given file path its size. @@ -110,7 +110,7 @@ abstract class Device * * @return int */ - abstract public function getFileSize(string $path):int; + abstract public function getFileSize(string $path): int; /** * Returns given file path its mime type. @@ -121,7 +121,7 @@ abstract class Device * * @return string */ - abstract public function getFileMimeType(string $path):string; + abstract public function getFileMimeType(string $path): string; /** * Returns given file path its MD5 hash value. @@ -132,7 +132,7 @@ abstract class Device * * @return string */ - abstract public function getFileHash(string $path):string; + abstract public function getFileHash(string $path): string; /** * Get directory size in bytes. @@ -145,7 +145,7 @@ abstract class Device * * @return int */ - abstract public function getDirectorySize(string $path):int; + abstract public function getDirectorySize(string $path): int; /** * Get Partition Free Space. @@ -154,7 +154,7 @@ abstract class Device * * @return float */ - abstract public function getPartitionFreeSpace():float; + abstract public function getPartitionFreeSpace(): float; /** * Get Partition Total Space. @@ -163,5 +163,5 @@ abstract class Device * * @return float */ - abstract public function getPartitionTotalSpace():float; + abstract public function getPartitionTotalSpace(): float; } diff --git a/src/Appwrite/Storage/Device/Local.php b/src/Appwrite/Storage/Device/Local.php index d786e2b07..81f97b8a7 100644 --- a/src/Appwrite/Storage/Device/Local.php +++ b/src/Appwrite/Storage/Device/Local.php @@ -72,7 +72,7 @@ class Local extends Device * * @throws \Exception * - * @return string|bool saved destination on success or false on failures + * @return bool */ public function upload($source, $path):bool { @@ -109,7 +109,7 @@ class Local extends Device * * @return bool */ - public function write(string $path, string $data):bool + public function write(string $path, string $data): bool { if (!\file_exists(\dirname($path))) { // Checks if directory path to file exists if (!@\mkdir(\dirname($path), 0755, true)) { @@ -117,7 +117,7 @@ class Local extends Device } } - return \file_put_contents($path, $data); + return (bool)\file_put_contents($path, $data); } /** diff --git a/src/Appwrite/Storage/Device/S3.php b/src/Appwrite/Storage/Device/S3.php index 2b46c8d44..adfe7e8be 100644 --- a/src/Appwrite/Storage/Device/S3.php +++ b/src/Appwrite/Storage/Device/S3.php @@ -51,7 +51,7 @@ class S3 extends Device * * @throws \Exception * - * @return string|bool saved destination on success or false on failures + * @return bool */ public function upload($source, $path):bool { diff --git a/src/Appwrite/Storage/Storage.php b/src/Appwrite/Storage/Storage.php index 30718dc0a..fc98f19fd 100644 --- a/src/Appwrite/Storage/Storage.php +++ b/src/Appwrite/Storage/Storage.php @@ -24,8 +24,10 @@ class Storage * @param Device $device * * @throws Exception + * + * @return void */ - public static function setDevice($name, Device $device) + public static function setDevice($name, Device $device): void { self::$devices[$name] = $device; } @@ -104,7 +106,7 @@ class Storage ), ); - $factor = floor((strlen($bytes) - 1) / 3); + $factor = (int)floor((strlen((string)$bytes) - 1) / 3); return sprintf("%.{$decimals}f%s", $bytes / pow($mod, $factor), $units[$system][$factor]); } diff --git a/src/Appwrite/Storage/Validator/File.php b/src/Appwrite/Storage/Validator/File.php index bbae19e61..1ca7140bb 100644 --- a/src/Appwrite/Storage/Validator/File.php +++ b/src/Appwrite/Storage/Validator/File.php @@ -16,7 +16,7 @@ class File extends Validator * * TODO think what to do here, currently only used for parameter to be present in SDKs * - * @param string $name + * @param mixed $name * * @return bool */ diff --git a/src/Appwrite/Storage/Validator/FileName.php b/src/Appwrite/Storage/Validator/FileName.php index 728e46552..a7d2e43a7 100644 --- a/src/Appwrite/Storage/Validator/FileName.php +++ b/src/Appwrite/Storage/Validator/FileName.php @@ -14,7 +14,7 @@ class FileName extends Validator /** * The file name can only contain "a-z", "A-Z", "0-9" and "-" and not empty. * - * @param string $name + * @param mixed $name * * @return bool */ @@ -24,6 +24,10 @@ class FileName extends Validator return false; } + if(!is_string($name)) { + return false; + } + if (!\preg_match('/^[a-zA-Z0-9.]+$/', $name)) { return false; } diff --git a/src/Appwrite/Storage/Validator/FileSize.php b/src/Appwrite/Storage/Validator/FileSize.php index 1f66e3f02..ab5d36144 100644 --- a/src/Appwrite/Storage/Validator/FileSize.php +++ b/src/Appwrite/Storage/Validator/FileSize.php @@ -29,12 +29,16 @@ class FileSize extends Validator /** * Finds whether a file size is smaller than required limit. * - * @param int $fileSize + * @param mixed $fileSize * * @return bool */ public function isValid($fileSize) { + if(!is_int($fileSize)) { + return false; + } + if ($fileSize > $this->max) { return false; } diff --git a/src/Appwrite/Storage/Validator/Upload.php b/src/Appwrite/Storage/Validator/Upload.php index c5bef78c4..023946442 100644 --- a/src/Appwrite/Storage/Validator/Upload.php +++ b/src/Appwrite/Storage/Validator/Upload.php @@ -14,12 +14,16 @@ class Upload extends Validator /** * Check if a file is a valid upload file * - * @param string $path + * @param mixed $path * * @return bool */ public function isValid($path) { + if(!is_string($path)) { + return false; + } + if (\is_uploaded_file($path)) { return true; } diff --git a/src/Appwrite/Swoole/Files.php b/src/Appwrite/Swoole/Files.php index aedfd22e0..7971beba2 100644 --- a/src/Appwrite/Swoole/Files.php +++ b/src/Appwrite/Swoole/Files.php @@ -32,20 +32,24 @@ class Files /** * Add MimeType - * + * * @var string $mimeType + * + * @return void */ - public static function addMimeType(string $mimeType) + public static function addMimeType(string $mimeType): void { self::$mimeTypes[$mimeType] = true; } /** * Remove MimeType - * + * * @var string $mimeType + * + * @return void */ - public static function removeMimeType(string $mimeType) + public static function removeMimeType(string $mimeType): void { if(isset(self::$mimeTypes[$mimeType])) { unset(self::$mimeTypes[$mimeType]); @@ -74,10 +78,12 @@ class Files /** * Load - * + * * @var string $path + * + * @return void */ - public static function load(string $directory, string $root = null) + public static function load(string $directory, string $root = null): void { if(!is_readable($directory)) { throw new Exception('Failed to load directory: '.$directory); diff --git a/src/Appwrite/Swoole/Request.php b/src/Appwrite/Swoole/Request.php index 55b599738..453592468 100644 --- a/src/Appwrite/Swoole/Request.php +++ b/src/Appwrite/Swoole/Request.php @@ -12,7 +12,7 @@ class Request extends UtopiaRequest * * @var SwooleRequest */ - protected $swoole = null; + protected $swoole; /** * Request constructor. @@ -265,9 +265,10 @@ class Request extends UtopiaRequest * * Method for querying HTTP cookie parameters. If $key is not found $default value will be returned. * - * @param string $key - * @param string $default - * @return mixed + * @param string $key + * @param string $default + * + * @return string */ public function getCookie(string $key, string $default = ''): string { diff --git a/src/Appwrite/Swoole/Response.php b/src/Appwrite/Swoole/Response.php index 88ab1fcd4..766101146 100644 --- a/src/Appwrite/Swoole/Response.php +++ b/src/Appwrite/Swoole/Response.php @@ -12,7 +12,7 @@ class Response extends UtopiaResponse * * @var SwooleResponse */ - protected $swoole = null; + protected $swoole; /** * Mime Types @@ -50,12 +50,12 @@ class Response extends UtopiaResponse * @param string $body * @param int $exit exit code or don't exit if code is null * - * @return self + * @return void */ public function send(string $body = '', int $exit = null): void { if(!$this->disablePayload) { - $this->addHeader('X-Debug-Speed', microtime(true) - $this->startTime); + $this->addHeader('X-Debug-Speed', (string)(microtime(true) - $this->startTime)); $this ->appendCookies() @@ -96,7 +96,7 @@ class Response extends UtopiaResponse protected function appendHeaders(): self { // Send status code header - $this->swoole->status($this->statusCode); + $this->swoole->status((string)$this->statusCode); // Send content type header $this diff --git a/src/Appwrite/URL/URL.php b/src/Appwrite/URL/URL.php index 5f2b54a65..6e32f8dfb 100644 --- a/src/Appwrite/URL/URL.php +++ b/src/Appwrite/URL/URL.php @@ -97,9 +97,9 @@ class URL * * Convert query string array to string * - * @param string $query + * @param array $query * - * @return array + * @return string */ public static function unparseQuery(array $query):string { diff --git a/src/Appwrite/Utopia/Response.php b/src/Appwrite/Utopia/Response.php index 414168ce9..b2a9f5b5d 100644 --- a/src/Appwrite/Utopia/Response.php +++ b/src/Appwrite/Utopia/Response.php @@ -52,8 +52,10 @@ class Response extends UtopiaResponse /** * Response constructor. + * + * @param float $time */ - public function __construct(int $time = 0) + public function __construct(float $time = 0) { $this ->setModel(new Error()) @@ -161,8 +163,10 @@ class Response extends UtopiaResponse * @see https://en.wikipedia.org/wiki/YAML * * @param array $data + * + * @return void */ - public function yaml(array $data) + public function yaml(array $data): void { if(!extension_loaded('yaml')) { throw new Exception('Missing yaml extension. Learn more at: https://www.php.net/manual/en/book.yaml.php'); diff --git a/src/Appwrite/Utopia/Response/Model.php b/src/Appwrite/Utopia/Response/Model.php index b50224935..36a2745e0 100644 --- a/src/Appwrite/Utopia/Response/Model.php +++ b/src/Appwrite/Utopia/Response/Model.php @@ -4,6 +4,9 @@ namespace Appwrite\Utopia\Response; abstract class Model { + /** + * @return array + */ protected $rules = []; /** @@ -23,7 +26,7 @@ abstract class Model /** * Get Rules * - * @return string + * @return array */ public function getRules(): array { diff --git a/src/Appwrite/Utopia/Response/Model/Error.php b/src/Appwrite/Utopia/Response/Model/Error.php index 95a4764d4..44cb2a1c8 100644 --- a/src/Appwrite/Utopia/Response/Model/Error.php +++ b/src/Appwrite/Utopia/Response/Model/Error.php @@ -23,7 +23,7 @@ class Error extends Model ->addRule('version', [ 'type' => 'string', 'description' => 'Server version number.', - 'example' => APP_VERSION_STABLE, + 'example' => '1.0', ]) ; } diff --git a/src/Appwrite/Utopia/Response/Model/Locale.php b/src/Appwrite/Utopia/Response/Model/Locale.php index b6482d7a9..1097a9457 100644 --- a/src/Appwrite/Utopia/Response/Model/Locale.php +++ b/src/Appwrite/Utopia/Response/Model/Locale.php @@ -43,7 +43,6 @@ class Locale extends Model ]) ->addRule('currency', [ 'type' => 'string', - 'description' => 'ISO 4217 Email verification status.', 'description' => 'Currency code in [ISO 4217-1](http://en.wikipedia.org/wiki/ISO_4217) three-character format', 'example' => 'USD', ])