diff --git a/.gitignore b/.gitignore index 13dee46..c5b018d 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,5 @@ uguu.sq3 .idea .phpdoc .vscode +composer.phar +composer.lock diff --git a/Makefile b/Makefile index c04b8dc..f044aac 100644 --- a/Makefile +++ b/Makefile @@ -43,19 +43,25 @@ copy-img: copy-php: cp -v $(CURDIR)/src/static/php/*.php $(CURDIR)/build/php/ + cp -v $(CURDIR)/src/Classes/*.php $(CURDIR)/build/php/classes/ install: installdirs cp -rv $(CURDIR)/build/* $(DESTDIR)/ - mv $(DESTDIR)/html/min/* $(DESTDIR)/ - mv $(DESTDIR)/js/* $(DESTDIR)/ - mv $(DESTDIR)/css/* $(DESTDIR)/ + cp -rv $(CURDIR)/vendor $(DESTDIR)/ + cp $(CURDIR)/src/config.json $(DESTDIR)/ + mv $(DESTDIR)/html/min/* $(DESTDIR)/public/ + mv $(DESTDIR)/js/* $(DESTDIR)/public/ + mv $(DESTDIR)/css/* $(DESTDIR)/public/ mv $(DESTDIR)/php/* $(DESTDIR)/ rm -rf $(DESTDIR)/html rm -rf $(DESTDIR)/css rm -rf $(DESTDIR)/js rm -rf $(DESTDIR)/php - mv $(DESTDIR)/uguu.css $(DESTDIR)/uguu.min.css - mv $(DESTDIR)/uguu.js $(DESTDIR)/uguu.min.js + mv $(DESTDIR)/public/uguu.css $(DESTDIR)/public/uguu.min.css + mv $(DESTDIR)/public/uguu.js $(DESTDIR)/public/uguu.min.js + mv $(DESTDIR)/img $(DESTDIR)/public/ + mv $(DESTDIR)/grill.php $(DESTDIR)/public/ + mv $(DESTDIR)/upload.php $(DESTDIR)/public/ dist: DESTDIR=$(TMPDIR)/uguu-$(PKGVERSION) @@ -98,5 +104,5 @@ purge-container: fi; builddirs: - mkdir -p $(CURDIR)/build $(CURDIR)/build/img $(CURDIR)/build/html $(CURDIR)/build/html/min $(CURDIR)/build/html/unmin $(CURDIR)/build/js $(CURDIR)/build/css $(CURDIR)/build/php + mkdir -p $(CURDIR)/build $(CURDIR)/build/img $(CURDIR)/build/html $(CURDIR)/build/html/min $(CURDIR)/build/html/unmin $(CURDIR)/build/js $(CURDIR)/build/css $(CURDIR)/build/php $(CURDIR)/build/php/classes $(CURDIR)/build/public diff --git a/composer.lock b/composer.lock index 531e418..2dd065d 100644 --- a/composer.lock +++ b/composer.lock @@ -248,16 +248,16 @@ }, { "name": "composer/pcre", - "version": "3.0.0", + "version": "3.1.0", "source": { "type": "git", "url": "https://github.com/composer/pcre.git", - "reference": "e300eb6c535192decd27a85bc72a9290f0d6b3bd" + "reference": "4bff79ddd77851fe3cdd11616ed3f92841ba5bd2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/pcre/zipball/e300eb6c535192decd27a85bc72a9290f0d6b3bd", - "reference": "e300eb6c535192decd27a85bc72a9290f0d6b3bd", + "url": "https://api.github.com/repos/composer/pcre/zipball/4bff79ddd77851fe3cdd11616ed3f92841ba5bd2", + "reference": "4bff79ddd77851fe3cdd11616ed3f92841ba5bd2", "shasum": "" }, "require": { @@ -299,7 +299,7 @@ ], "support": { "issues": "https://github.com/composer/pcre/issues", - "source": "https://github.com/composer/pcre/tree/3.0.0" + "source": "https://github.com/composer/pcre/tree/3.1.0" }, "funding": [ { @@ -315,7 +315,7 @@ "type": "tidelift" } ], - "time": "2022-02-25T20:21:48+00:00" + "time": "2022-11-17T09:50:14+00:00" }, { "name": "composer/semver", @@ -503,32 +503,35 @@ }, { "name": "doctrine/annotations", - "version": "1.13.3", + "version": "1.14.1", "source": { "type": "git", "url": "https://github.com/doctrine/annotations.git", - "reference": "648b0343343565c4a056bfc8392201385e8d89f0" + "reference": "9e034d7a70032d422169f27d8759e8d84abb4f51" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/annotations/zipball/648b0343343565c4a056bfc8392201385e8d89f0", - "reference": "648b0343343565c4a056bfc8392201385e8d89f0", + "url": "https://api.github.com/repos/doctrine/annotations/zipball/9e034d7a70032d422169f27d8759e8d84abb4f51", + "reference": "9e034d7a70032d422169f27d8759e8d84abb4f51", "shasum": "" }, "require": { - "doctrine/lexer": "1.*", + "doctrine/lexer": "^1 || ^2", "ext-tokenizer": "*", "php": "^7.1 || ^8.0", "psr/cache": "^1 || ^2 || ^3" }, "require-dev": { "doctrine/cache": "^1.11 || ^2.0", - "doctrine/coding-standard": "^6.0 || ^8.1", - "phpstan/phpstan": "^1.4.10 || ^1.8.0", - "phpunit/phpunit": "^7.5 || ^8.0 || ^9.1.5", - "symfony/cache": "^4.4 || ^5.2", + "doctrine/coding-standard": "^9 || ^10", + "phpstan/phpstan": "~1.4.10 || ^1.8.0", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "symfony/cache": "^4.4 || ^5.4 || ^6", "vimeo/psalm": "^4.10" }, + "suggest": { + "php": "PHP 8.0 or higher comes with attributes, a native replacement for annotations" + }, "type": "library", "autoload": { "psr-4": { @@ -570,9 +573,52 @@ ], "support": { "issues": "https://github.com/doctrine/annotations/issues", - "source": "https://github.com/doctrine/annotations/tree/1.13.3" + "source": "https://github.com/doctrine/annotations/tree/1.14.1" }, - "time": "2022-07-02T10:48:51+00:00" + "time": "2022-12-12T12:46:12+00:00" + }, + { + "name": "doctrine/deprecations", + "version": "v1.0.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/deprecations.git", + "reference": "0e2a4f1f8cdfc7a92ec3b01c9334898c806b30de" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/deprecations/zipball/0e2a4f1f8cdfc7a92ec3b01c9334898c806b30de", + "reference": "0e2a4f1f8cdfc7a92ec3b01c9334898c806b30de", + "shasum": "" + }, + "require": { + "php": "^7.1|^8.0" + }, + "require-dev": { + "doctrine/coding-standard": "^9", + "phpunit/phpunit": "^7.5|^8.5|^9.5", + "psr/log": "^1|^2|^3" + }, + "suggest": { + "psr/log": "Allows logging deprecations via PSR-3 logger implementation" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Deprecations\\": "lib/Doctrine/Deprecations" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "A small layer on top of trigger_error(E_USER_DEPRECATED) or PSR-3 logging with options to disable all deprecations or selectively for packages.", + "homepage": "https://www.doctrine-project.org/", + "support": { + "issues": "https://github.com/doctrine/deprecations/issues", + "source": "https://github.com/doctrine/deprecations/tree/v1.0.0" + }, + "time": "2022-05-02T15:47:09+00:00" }, { "name": "doctrine/instantiator", @@ -646,31 +692,33 @@ }, { "name": "doctrine/lexer", - "version": "1.2.3", + "version": "2.1.0", "source": { "type": "git", "url": "https://github.com/doctrine/lexer.git", - "reference": "c268e882d4dbdd85e36e4ad69e02dc284f89d229" + "reference": "39ab8fcf5a51ce4b85ca97c7a7d033eb12831124" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/lexer/zipball/c268e882d4dbdd85e36e4ad69e02dc284f89d229", - "reference": "c268e882d4dbdd85e36e4ad69e02dc284f89d229", + "url": "https://api.github.com/repos/doctrine/lexer/zipball/39ab8fcf5a51ce4b85ca97c7a7d033eb12831124", + "reference": "39ab8fcf5a51ce4b85ca97c7a7d033eb12831124", "shasum": "" }, "require": { + "doctrine/deprecations": "^1.0", "php": "^7.1 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "^9.0", + "doctrine/coding-standard": "^9 || ^10", "phpstan/phpstan": "^1.3", "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "vimeo/psalm": "^4.11" + "psalm/plugin-phpunit": "^0.18.3", + "vimeo/psalm": "^4.11 || ^5.0" }, "type": "library", "autoload": { "psr-4": { - "Doctrine\\Common\\Lexer\\": "lib/Doctrine/Common/Lexer" + "Doctrine\\Common\\Lexer\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -702,7 +750,7 @@ ], "support": { "issues": "https://github.com/doctrine/lexer/issues", - "source": "https://github.com/doctrine/lexer/tree/1.2.3" + "source": "https://github.com/doctrine/lexer/tree/2.1.0" }, "funding": [ { @@ -718,7 +766,7 @@ "type": "tidelift" } ], - "time": "2022-02-28T11:07:21+00:00" + "time": "2022-12-14T08:49:07+00:00" }, { "name": "felixfbecker/advanced-json-rpc", @@ -822,17 +870,78 @@ "time": "2022-03-02T22:36:06+00:00" }, { - "name": "friendsofphp/php-cs-fixer", - "version": "v3.9.4", + "name": "fidry/cpu-core-counter", + "version": "0.4.0", "source": { "type": "git", - "url": "https://github.com/FriendsOfPHP/PHP-CS-Fixer.git", - "reference": "093466b1c3ff3e3b469bdbc9827bb2362de6b2fa" + "url": "https://github.com/theofidry/cpu-core-counter.git", + "reference": "666cb04a02f2801f3b19955fc23c824f9018bf64" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/093466b1c3ff3e3b469bdbc9827bb2362de6b2fa", - "reference": "093466b1c3ff3e3b469bdbc9827bb2362de6b2fa", + "url": "https://api.github.com/repos/theofidry/cpu-core-counter/zipball/666cb04a02f2801f3b19955fc23c824f9018bf64", + "reference": "666cb04a02f2801f3b19955fc23c824f9018bf64", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "require-dev": { + "fidry/makefile": "^0.2.0", + "phpstan/extension-installer": "^1.2.0", + "phpstan/phpstan": "^1.9.2", + "phpstan/phpstan-deprecation-rules": "^1.0.0", + "phpstan/phpstan-phpunit": "^1.2.2", + "phpstan/phpstan-strict-rules": "^1.4.4", + "phpunit/phpunit": "^9.5.26 || ^8.5.31", + "theofidry/php-cs-fixer-config": "^1.0", + "webmozarts/strict-phpunit": "^7.5" + }, + "type": "library", + "autoload": { + "psr-4": { + "Fidry\\CpuCoreCounter\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Théo FIDRY", + "email": "theo.fidry@gmail.com" + } + ], + "description": "Tiny utility to get the number of CPU cores.", + "keywords": [ + "CPU", + "core" + ], + "support": { + "issues": "https://github.com/theofidry/cpu-core-counter/issues", + "source": "https://github.com/theofidry/cpu-core-counter/tree/0.4.0" + }, + "funding": [ + { + "url": "https://github.com/theofidry", + "type": "github" + } + ], + "time": "2022-12-10T21:26:31+00:00" + }, + { + "name": "friendsofphp/php-cs-fixer", + "version": "v3.13.0", + "source": { + "type": "git", + "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git", + "reference": "a6232229a8309e8811dc751c28b91cb34b2943e1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/a6232229a8309e8811dc751c28b91cb34b2943e1", + "reference": "a6232229a8309e8811dc751c28b91cb34b2943e1", "shasum": "" }, "require": { @@ -842,7 +951,7 @@ "ext-json": "*", "ext-tokenizer": "*", "php": "^7.4 || ^8.0", - "php-cs-fixer/diff": "^2.0", + "sebastian/diff": "^4.0", "symfony/console": "^5.4 || ^6.0", "symfony/event-dispatcher": "^5.4 || ^6.0", "symfony/filesystem": "^5.4 || ^6.0", @@ -856,7 +965,7 @@ }, "require-dev": { "justinrainbow/json-schema": "^5.2", - "keradus/cli-executor": "^1.5", + "keradus/cli-executor": "^2.0", "mikey179/vfsstream": "^1.6.10", "php-coveralls/php-coveralls": "^2.5.2", "php-cs-fixer/accessible-object": "^1.1", @@ -865,8 +974,8 @@ "phpspec/prophecy": "^1.15", "phpspec/prophecy-phpunit": "^2.0", "phpunit/phpunit": "^9.5", - "phpunitgoodpractices/polyfill": "^1.5", - "phpunitgoodpractices/traits": "^1.9.1", + "phpunitgoodpractices/polyfill": "^1.6", + "phpunitgoodpractices/traits": "^1.9.2", "symfony/phpunit-bridge": "^6.0", "symfony/yaml": "^5.4 || ^6.0" }, @@ -899,8 +1008,8 @@ ], "description": "A tool to automatically fix PHP code style", "support": { - "issues": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/issues", - "source": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/tree/v3.9.4" + "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues", + "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.13.0" }, "funding": [ { @@ -908,7 +1017,7 @@ "type": "github" } ], - "time": "2022-07-15T21:04:49+00:00" + "time": "2022-10-31T19:28:50+00:00" }, { "name": "myclabs/deep-copy", @@ -971,16 +1080,16 @@ }, { "name": "netresearch/jsonmapper", - "version": "v4.0.0", + "version": "v4.1.0", "source": { "type": "git", "url": "https://github.com/cweiske/jsonmapper.git", - "reference": "8bbc021a8edb2e4a7ea2f8ad4fa9ec9dce2fcb8d" + "reference": "cfa81ea1d35294d64adb9c68aa4cb9e92400e53f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cweiske/jsonmapper/zipball/8bbc021a8edb2e4a7ea2f8ad4fa9ec9dce2fcb8d", - "reference": "8bbc021a8edb2e4a7ea2f8ad4fa9ec9dce2fcb8d", + "url": "https://api.github.com/repos/cweiske/jsonmapper/zipball/cfa81ea1d35294d64adb9c68aa4cb9e92400e53f", + "reference": "cfa81ea1d35294d64adb9c68aa4cb9e92400e53f", "shasum": "" }, "require": { @@ -1016,22 +1125,22 @@ "support": { "email": "cweiske@cweiske.de", "issues": "https://github.com/cweiske/jsonmapper/issues", - "source": "https://github.com/cweiske/jsonmapper/tree/v4.0.0" + "source": "https://github.com/cweiske/jsonmapper/tree/v4.1.0" }, - "time": "2020-12-01T19:48:11+00:00" + "time": "2022-12-08T20:46:14+00:00" }, { "name": "nikic/php-parser", - "version": "v4.14.0", + "version": "v4.15.2", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "34bea19b6e03d8153165d8f30bba4c3be86184c1" + "reference": "f59bbe44bf7d96f24f3e2b4ddc21cd52c1d2adbc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/34bea19b6e03d8153165d8f30bba4c3be86184c1", - "reference": "34bea19b6e03d8153165d8f30bba4c3be86184c1", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/f59bbe44bf7d96f24f3e2b4ddc21cd52c1d2adbc", + "reference": "f59bbe44bf7d96f24f3e2b4ddc21cd52c1d2adbc", "shasum": "" }, "require": { @@ -1072,9 +1181,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.14.0" + "source": "https://github.com/nikic/PHP-Parser/tree/v4.15.2" }, - "time": "2022-05-31T20:59:12+00:00" + "time": "2022-11-12T15:38:23+00:00" }, { "name": "openlss/lib-array2xml", @@ -1131,16 +1240,16 @@ }, { "name": "pdepend/pdepend", - "version": "2.10.3", + "version": "2.12.1", "source": { "type": "git", "url": "https://github.com/pdepend/pdepend.git", - "reference": "da3166a06b4a89915920a42444f707122a1584c9" + "reference": "7a892d56ceafd804b4a2ecc85184640937ce9e84" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pdepend/pdepend/zipball/da3166a06b4a89915920a42444f707122a1584c9", - "reference": "da3166a06b4a89915920a42444f707122a1584c9", + "url": "https://api.github.com/repos/pdepend/pdepend/zipball/7a892d56ceafd804b4a2ecc85184640937ce9e84", + "reference": "7a892d56ceafd804b4a2ecc85184640937ce9e84", "shasum": "" }, "require": { @@ -1176,7 +1285,7 @@ "description": "Official version of pdepend to be handled with Composer", "support": { "issues": "https://github.com/pdepend/pdepend/issues", - "source": "https://github.com/pdepend/pdepend/tree/2.10.3" + "source": "https://github.com/pdepend/pdepend/tree/2.12.1" }, "funding": [ { @@ -1184,7 +1293,7 @@ "type": "tidelift" } ], - "time": "2022-02-23T07:53:09+00:00" + "time": "2022-09-08T19:30:37+00:00" }, { "name": "phar-io/manifest", @@ -1297,58 +1406,6 @@ }, "time": "2022-02-21T01:04:05+00:00" }, - { - "name": "php-cs-fixer/diff", - "version": "v2.0.2", - "source": { - "type": "git", - "url": "https://github.com/PHP-CS-Fixer/diff.git", - "reference": "29dc0d507e838c4580d018bd8b5cb412474f7ec3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/PHP-CS-Fixer/diff/zipball/29dc0d507e838c4580d018bd8b5cb412474f7ec3", - "reference": "29dc0d507e838c4580d018bd8b5cb412474f7ec3", - "shasum": "" - }, - "require": { - "php": "^5.6 || ^7.0 || ^8.0" - }, - "require-dev": { - "phpunit/phpunit": "^5.7.23 || ^6.4.3 || ^7.0", - "symfony/process": "^3.3" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Kore Nordmann", - "email": "mail@kore-nordmann.de" - } - ], - "description": "sebastian/diff v3 backport support for PHP 5.6+", - "homepage": "https://github.com/PHP-CS-Fixer", - "keywords": [ - "diff" - ], - "support": { - "issues": "https://github.com/PHP-CS-Fixer/diff/issues", - "source": "https://github.com/PHP-CS-Fixer/diff/tree/v2.0.2" - }, - "time": "2020-10-14T08:32:19+00:00" - }, { "name": "phpdocumentor/reflection-common", "version": "2.2.0", @@ -1461,25 +1518,30 @@ }, { "name": "phpdocumentor/type-resolver", - "version": "1.6.1", + "version": "1.6.2", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "77a32518733312af16a44300404e945338981de3" + "reference": "48f445a408c131e38cab1c235aa6d2bb7a0bb20d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/77a32518733312af16a44300404e945338981de3", - "reference": "77a32518733312af16a44300404e945338981de3", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/48f445a408c131e38cab1c235aa6d2bb7a0bb20d", + "reference": "48f445a408c131e38cab1c235aa6d2bb7a0bb20d", "shasum": "" }, "require": { - "php": "^7.2 || ^8.0", + "php": "^7.4 || ^8.0", "phpdocumentor/reflection-common": "^2.0" }, "require-dev": { "ext-tokenizer": "*", - "psalm/phar": "^4.8" + "phpstan/extension-installer": "^1.1", + "phpstan/phpstan": "^1.8", + "phpstan/phpstan-phpunit": "^1.1", + "phpunit/phpunit": "^9.5", + "rector/rector": "^0.13.9", + "vimeo/psalm": "^4.25" }, "type": "library", "extra": { @@ -1505,28 +1567,28 @@ "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", "support": { "issues": "https://github.com/phpDocumentor/TypeResolver/issues", - "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.6.1" + "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.6.2" }, - "time": "2022-03-15T21:29:03+00:00" + "time": "2022-10-14T12:47:21+00:00" }, { "name": "phpmd/phpmd", - "version": "2.12.0", + "version": "2.13.0", "source": { "type": "git", "url": "https://github.com/phpmd/phpmd.git", - "reference": "c0b678ba71902f539c27c14332aa0ddcf14388ec" + "reference": "dad0228156856b3ad959992f9748514fa943f3e3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpmd/phpmd/zipball/c0b678ba71902f539c27c14332aa0ddcf14388ec", - "reference": "c0b678ba71902f539c27c14332aa0ddcf14388ec", + "url": "https://api.github.com/repos/phpmd/phpmd/zipball/dad0228156856b3ad959992f9748514fa943f3e3", + "reference": "dad0228156856b3ad959992f9748514fa943f3e3", "shasum": "" }, "require": { "composer/xdebug-handler": "^1.0 || ^2.0 || ^3.0", "ext-xml": "*", - "pdepend/pdepend": "^2.10.3", + "pdepend/pdepend": "^2.12.1", "php": ">=5.3.9" }, "require-dev": { @@ -1582,7 +1644,7 @@ "support": { "irc": "irc://irc.freenode.org/phpmd", "issues": "https://github.com/phpmd/phpmd/issues", - "source": "https://github.com/phpmd/phpmd/tree/2.12.0" + "source": "https://github.com/phpmd/phpmd/tree/2.13.0" }, "funding": [ { @@ -1590,87 +1652,20 @@ "type": "tidelift" } ], - "time": "2022-03-24T13:33:01+00:00" - }, - { - "name": "phpspec/prophecy", - "version": "v1.15.0", - "source": { - "type": "git", - "url": "https://github.com/phpspec/prophecy.git", - "reference": "bbcd7380b0ebf3961ee21409db7b38bc31d69a13" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/bbcd7380b0ebf3961ee21409db7b38bc31d69a13", - "reference": "bbcd7380b0ebf3961ee21409db7b38bc31d69a13", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.2", - "php": "^7.2 || ~8.0, <8.2", - "phpdocumentor/reflection-docblock": "^5.2", - "sebastian/comparator": "^3.0 || ^4.0", - "sebastian/recursion-context": "^3.0 || ^4.0" - }, - "require-dev": { - "phpspec/phpspec": "^6.0 || ^7.0", - "phpunit/phpunit": "^8.0 || ^9.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, - "autoload": { - "psr-4": { - "Prophecy\\": "src/Prophecy" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - }, - { - "name": "Marcello Duarte", - "email": "marcello.duarte@gmail.com" - } - ], - "description": "Highly opinionated mocking framework for PHP 5.3+", - "homepage": "https://github.com/phpspec/prophecy", - "keywords": [ - "Double", - "Dummy", - "fake", - "mock", - "spy", - "stub" - ], - "support": { - "issues": "https://github.com/phpspec/prophecy/issues", - "source": "https://github.com/phpspec/prophecy/tree/v1.15.0" - }, - "time": "2021-12-08T12:19:24+00:00" + "time": "2022-09-10T08:44:15+00:00" }, { "name": "phpstan/phpstan", - "version": "1.8.2", + "version": "1.9.3", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "c53312ecc575caf07b0e90dee43883fdf90ca67c" + "reference": "709999b91448d4f2bb07daffffedc889b33e461c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/c53312ecc575caf07b0e90dee43883fdf90ca67c", - "reference": "c53312ecc575caf07b0e90dee43883fdf90ca67c", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/709999b91448d4f2bb07daffffedc889b33e461c", + "reference": "709999b91448d4f2bb07daffffedc889b33e461c", "shasum": "" }, "require": { @@ -1694,9 +1689,13 @@ "MIT" ], "description": "PHPStan - PHP Static Analysis Tool", + "keywords": [ + "dev", + "static analysis" + ], "support": { "issues": "https://github.com/phpstan/phpstan/issues", - "source": "https://github.com/phpstan/phpstan/tree/1.8.2" + "source": "https://github.com/phpstan/phpstan/tree/1.9.3" }, "funding": [ { @@ -1707,36 +1706,32 @@ "url": "https://github.com/phpstan", "type": "github" }, - { - "url": "https://www.patreon.com/phpstan", - "type": "patreon" - }, { "url": "https://tidelift.com/funding/github/packagist/phpstan/phpstan", "type": "tidelift" } ], - "time": "2022-07-20T09:57:31+00:00" + "time": "2022-12-13T10:28:10+00:00" }, { "name": "phpunit/php-code-coverage", - "version": "9.2.15", + "version": "9.2.21", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "2e9da11878c4202f97915c1cb4bb1ca318a63f5f" + "reference": "3f893e19712bb0c8bc86665d1562e9fd509c4ef0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/2e9da11878c4202f97915c1cb4bb1ca318a63f5f", - "reference": "2e9da11878c4202f97915c1cb4bb1ca318a63f5f", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/3f893e19712bb0c8bc86665d1562e9fd509c4ef0", + "reference": "3f893e19712bb0c8bc86665d1562e9fd509c4ef0", "shasum": "" }, "require": { "ext-dom": "*", "ext-libxml": "*", "ext-xmlwriter": "*", - "nikic/php-parser": "^4.13.0", + "nikic/php-parser": "^4.14", "php": ">=7.3", "phpunit/php-file-iterator": "^3.0.3", "phpunit/php-text-template": "^2.0.2", @@ -1785,7 +1780,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.15" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.21" }, "funding": [ { @@ -1793,7 +1788,7 @@ "type": "github" } ], - "time": "2022-03-07T09:28:20+00:00" + "time": "2022-12-14T13:26:54+00:00" }, { "name": "phpunit/php-file-iterator", @@ -2038,16 +2033,16 @@ }, { "name": "phpunit/phpunit", - "version": "9.5.21", + "version": "9.5.27", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "0e32b76be457de00e83213528f6bb37e2a38fcb1" + "reference": "a2bc7ffdca99f92d959b3f2270529334030bba38" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/0e32b76be457de00e83213528f6bb37e2a38fcb1", - "reference": "0e32b76be457de00e83213528f6bb37e2a38fcb1", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/a2bc7ffdca99f92d959b3f2270529334030bba38", + "reference": "a2bc7ffdca99f92d959b3f2270529334030bba38", "shasum": "" }, "require": { @@ -2062,7 +2057,6 @@ "phar-io/manifest": "^2.0.3", "phar-io/version": "^3.0.2", "php": ">=7.3", - "phpspec/prophecy": "^1.12.1", "phpunit/php-code-coverage": "^9.2.13", "phpunit/php-file-iterator": "^3.0.5", "phpunit/php-invoker": "^3.1.1", @@ -2070,19 +2064,16 @@ "phpunit/php-timer": "^5.0.2", "sebastian/cli-parser": "^1.0.1", "sebastian/code-unit": "^1.0.6", - "sebastian/comparator": "^4.0.5", + "sebastian/comparator": "^4.0.8", "sebastian/diff": "^4.0.3", "sebastian/environment": "^5.1.3", - "sebastian/exporter": "^4.0.3", + "sebastian/exporter": "^4.0.5", "sebastian/global-state": "^5.0.1", "sebastian/object-enumerator": "^4.0.3", "sebastian/resource-operations": "^3.0.3", - "sebastian/type": "^3.0", + "sebastian/type": "^3.2", "sebastian/version": "^3.0.2" }, - "require-dev": { - "phpspec/prophecy-phpunit": "^2.0.1" - }, "suggest": { "ext-soap": "*", "ext-xdebug": "*" @@ -2124,7 +2115,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.21" + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.27" }, "funding": [ { @@ -2134,9 +2125,13 @@ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpunit/phpunit", + "type": "tidelift" } ], - "time": "2022-06-19T12:14:25+00:00" + "time": "2022-12-09T07:31:23+00:00" }, { "name": "psr/cache", @@ -2509,16 +2504,16 @@ }, { "name": "sebastian/comparator", - "version": "4.0.6", + "version": "4.0.8", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "55f4261989e546dc112258c7a75935a81a7ce382" + "reference": "fa0f136dd2334583309d32b62544682ee972b51a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/55f4261989e546dc112258c7a75935a81a7ce382", - "reference": "55f4261989e546dc112258c7a75935a81a7ce382", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/fa0f136dd2334583309d32b62544682ee972b51a", + "reference": "fa0f136dd2334583309d32b62544682ee972b51a", "shasum": "" }, "require": { @@ -2571,7 +2566,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/comparator/issues", - "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.6" + "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.8" }, "funding": [ { @@ -2579,7 +2574,7 @@ "type": "github" } ], - "time": "2020-10-26T15:49:45+00:00" + "time": "2022-09-14T12:41:17+00:00" }, { "name": "sebastian/complexity", @@ -2769,16 +2764,16 @@ }, { "name": "sebastian/exporter", - "version": "4.0.4", + "version": "4.0.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "65e8b7db476c5dd267e65eea9cab77584d3cfff9" + "reference": "ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/65e8b7db476c5dd267e65eea9cab77584d3cfff9", - "reference": "65e8b7db476c5dd267e65eea9cab77584d3cfff9", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d", + "reference": "ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d", "shasum": "" }, "require": { @@ -2834,7 +2829,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/exporter/issues", - "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.4" + "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.5" }, "funding": [ { @@ -2842,7 +2837,7 @@ "type": "github" } ], - "time": "2021-11-11T14:18:36+00:00" + "time": "2022-09-14T06:03:37+00:00" }, { "name": "sebastian/global-state", @@ -3197,16 +3192,16 @@ }, { "name": "sebastian/type", - "version": "3.0.0", + "version": "3.2.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/type.git", - "reference": "b233b84bc4465aff7b57cf1c4bc75c86d00d6dad" + "reference": "fb3fe09c5f0bae6bc27ef3ce933a1e0ed9464b6e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/b233b84bc4465aff7b57cf1c4bc75c86d00d6dad", - "reference": "b233b84bc4465aff7b57cf1c4bc75c86d00d6dad", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/fb3fe09c5f0bae6bc27ef3ce933a1e0ed9464b6e", + "reference": "fb3fe09c5f0bae6bc27ef3ce933a1e0ed9464b6e", "shasum": "" }, "require": { @@ -3218,7 +3213,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "3.2-dev" } }, "autoload": { @@ -3241,7 +3236,7 @@ "homepage": "https://github.com/sebastianbergmann/type", "support": { "issues": "https://github.com/sebastianbergmann/type/issues", - "source": "https://github.com/sebastianbergmann/type/tree/3.0.0" + "source": "https://github.com/sebastianbergmann/type/tree/3.2.0" }, "funding": [ { @@ -3249,7 +3244,7 @@ "type": "github" } ], - "time": "2022-03-15T09:54:48+00:00" + "time": "2022-09-12T14:47:03+00:00" }, { "name": "sebastian/version", @@ -3362,16 +3357,16 @@ }, { "name": "symfony/config", - "version": "v6.1.0", + "version": "v6.2.0", "source": { "type": "git", "url": "https://github.com/symfony/config.git", - "reference": "ed8d12417bcacd2d969750feb1fe1aab1c11e613" + "reference": "ebf27792246165a2a0b6b69ec9c620cac8c5a2f0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/config/zipball/ed8d12417bcacd2d969750feb1fe1aab1c11e613", - "reference": "ed8d12417bcacd2d969750feb1fe1aab1c11e613", + "url": "https://api.github.com/repos/symfony/config/zipball/ebf27792246165a2a0b6b69ec9c620cac8c5a2f0", + "reference": "ebf27792246165a2a0b6b69ec9c620cac8c5a2f0", "shasum": "" }, "require": { @@ -3419,7 +3414,7 @@ "description": "Helps you find, load, combine, autofill and validate configuration values of any kind", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/config/tree/v6.1.0" + "source": "https://github.com/symfony/config/tree/v6.2.0" }, "funding": [ { @@ -3435,20 +3430,20 @@ "type": "tidelift" } ], - "time": "2022-05-17T12:56:32+00:00" + "time": "2022-11-02T09:08:04+00:00" }, { "name": "symfony/console", - "version": "v6.1.2", + "version": "v6.2.1", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "7a86c1c42fbcb69b59768504c7bca1d3767760b7" + "reference": "58f6cef5dc5f641b7bbdbf8b32b44cc926c35f3f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/7a86c1c42fbcb69b59768504c7bca1d3767760b7", - "reference": "7a86c1c42fbcb69b59768504c7bca1d3767760b7", + "url": "https://api.github.com/repos/symfony/console/zipball/58f6cef5dc5f641b7bbdbf8b32b44cc926c35f3f", + "reference": "58f6cef5dc5f641b7bbdbf8b32b44cc926c35f3f", "shasum": "" }, "require": { @@ -3515,7 +3510,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v6.1.2" + "source": "https://github.com/symfony/console/tree/v6.2.1" }, "funding": [ { @@ -3531,33 +3526,34 @@ "type": "tidelift" } ], - "time": "2022-06-26T13:01:30+00:00" + "time": "2022-12-01T13:44:20+00:00" }, { "name": "symfony/dependency-injection", - "version": "v6.1.2", + "version": "v6.2.1", "source": { "type": "git", "url": "https://github.com/symfony/dependency-injection.git", - "reference": "5635ff016a814d7984b1c4644ad28e7df546077b" + "reference": "1989baaa573b64eab1a8535717e3e8670e06cb7a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/5635ff016a814d7984b1c4644ad28e7df546077b", - "reference": "5635ff016a814d7984b1c4644ad28e7df546077b", + "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/1989baaa573b64eab1a8535717e3e8670e06cb7a", + "reference": "1989baaa573b64eab1a8535717e3e8670e06cb7a", "shasum": "" }, "require": { "php": ">=8.1", "psr/container": "^1.1|^2.0", "symfony/deprecation-contracts": "^2.1|^3", - "symfony/service-contracts": "^1.1.6|^2.0|^3.0" + "symfony/service-contracts": "^1.1.6|^2.0|^3.0", + "symfony/var-exporter": "^6.2" }, "conflict": { "ext-psr": "<1.1|>=2", "symfony/config": "<6.1", "symfony/finder": "<5.4", - "symfony/proxy-manager-bridge": "<5.4", + "symfony/proxy-manager-bridge": "<6.2", "symfony/yaml": "<5.4" }, "provide": { @@ -3573,7 +3569,6 @@ "symfony/config": "", "symfony/expression-language": "For using expressions in service container configuration", "symfony/finder": "For using double-star glob patterns or when GLOB_BRACE portability is required", - "symfony/proxy-manager-bridge": "Generate service proxies to lazy load them", "symfony/yaml": "" }, "type": "library", @@ -3602,7 +3597,7 @@ "description": "Allows you to standardize and centralize the way objects are constructed in your application", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/dependency-injection/tree/v6.1.2" + "source": "https://github.com/symfony/dependency-injection/tree/v6.2.1" }, "funding": [ { @@ -3618,20 +3613,20 @@ "type": "tidelift" } ], - "time": "2022-06-26T13:01:30+00:00" + "time": "2022-12-06T17:08:33+00:00" }, { "name": "symfony/deprecation-contracts", - "version": "v3.1.1", + "version": "v3.2.0", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "07f1b9cc2ffee6aaafcf4b710fbc38ff736bd918" + "reference": "1ee04c65529dea5d8744774d474e7cbd2f1206d3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/07f1b9cc2ffee6aaafcf4b710fbc38ff736bd918", - "reference": "07f1b9cc2ffee6aaafcf4b710fbc38ff736bd918", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/1ee04c65529dea5d8744774d474e7cbd2f1206d3", + "reference": "1ee04c65529dea5d8744774d474e7cbd2f1206d3", "shasum": "" }, "require": { @@ -3640,7 +3635,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "3.1-dev" + "dev-main": "3.3-dev" }, "thanks": { "name": "symfony/contracts", @@ -3669,7 +3664,7 @@ "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v3.1.1" + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.2.0" }, "funding": [ { @@ -3685,20 +3680,20 @@ "type": "tidelift" } ], - "time": "2022-02-25T11:15:52+00:00" + "time": "2022-11-25T10:21:52+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v6.1.0", + "version": "v6.2.0", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "a0449a7ad7daa0f7c0acd508259f80544ab5a347" + "reference": "9efb1618fabee89515fe031314e8ed5625f85a53" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/a0449a7ad7daa0f7c0acd508259f80544ab5a347", - "reference": "a0449a7ad7daa0f7c0acd508259f80544ab5a347", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/9efb1618fabee89515fe031314e8ed5625f85a53", + "reference": "9efb1618fabee89515fe031314e8ed5625f85a53", "shasum": "" }, "require": { @@ -3752,7 +3747,7 @@ "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/event-dispatcher/tree/v6.1.0" + "source": "https://github.com/symfony/event-dispatcher/tree/v6.2.0" }, "funding": [ { @@ -3768,20 +3763,20 @@ "type": "tidelift" } ], - "time": "2022-05-05T16:51:07+00:00" + "time": "2022-11-02T09:08:04+00:00" }, { "name": "symfony/event-dispatcher-contracts", - "version": "v3.1.1", + "version": "v3.2.0", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher-contracts.git", - "reference": "02ff5eea2f453731cfbc6bc215e456b781480448" + "reference": "0782b0b52a737a05b4383d0df35a474303cabdae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/02ff5eea2f453731cfbc6bc215e456b781480448", - "reference": "02ff5eea2f453731cfbc6bc215e456b781480448", + "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/0782b0b52a737a05b4383d0df35a474303cabdae", + "reference": "0782b0b52a737a05b4383d0df35a474303cabdae", "shasum": "" }, "require": { @@ -3794,7 +3789,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "3.1-dev" + "dev-main": "3.3-dev" }, "thanks": { "name": "symfony/contracts", @@ -3831,7 +3826,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.1.1" + "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.2.0" }, "funding": [ { @@ -3847,20 +3842,20 @@ "type": "tidelift" } ], - "time": "2022-02-25T11:15:52+00:00" + "time": "2022-11-25T10:21:52+00:00" }, { "name": "symfony/filesystem", - "version": "v6.1.0", + "version": "v6.2.0", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "3132d2f43ca799c2aa099f9738d98228c56baa5d" + "reference": "50b2523c874605cf3d4acf7a9e2b30b6a440a016" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/3132d2f43ca799c2aa099f9738d98228c56baa5d", - "reference": "3132d2f43ca799c2aa099f9738d98228c56baa5d", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/50b2523c874605cf3d4acf7a9e2b30b6a440a016", + "reference": "50b2523c874605cf3d4acf7a9e2b30b6a440a016", "shasum": "" }, "require": { @@ -3894,7 +3889,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v6.1.0" + "source": "https://github.com/symfony/filesystem/tree/v6.2.0" }, "funding": [ { @@ -3910,20 +3905,20 @@ "type": "tidelift" } ], - "time": "2022-05-21T13:34:40+00:00" + "time": "2022-11-20T13:01:27+00:00" }, { "name": "symfony/finder", - "version": "v6.1.0", + "version": "v6.2.0", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "45b8beb69d6eb3b05a65689ebfd4222326773f8f" + "reference": "eb2355f69519e4ef33f1835bca4c935f5d42e570" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/45b8beb69d6eb3b05a65689ebfd4222326773f8f", - "reference": "45b8beb69d6eb3b05a65689ebfd4222326773f8f", + "url": "https://api.github.com/repos/symfony/finder/zipball/eb2355f69519e4ef33f1835bca4c935f5d42e570", + "reference": "eb2355f69519e4ef33f1835bca4c935f5d42e570", "shasum": "" }, "require": { @@ -3958,7 +3953,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v6.1.0" + "source": "https://github.com/symfony/finder/tree/v6.2.0" }, "funding": [ { @@ -3974,20 +3969,20 @@ "type": "tidelift" } ], - "time": "2022-04-15T08:08:08+00:00" + "time": "2022-10-09T08:55:40+00:00" }, { "name": "symfony/options-resolver", - "version": "v6.1.0", + "version": "v6.2.0", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", - "reference": "a3016f5442e28386ded73c43a32a5b68586dd1c4" + "reference": "d28f02acde71ff75e957082cd36e973df395f626" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/a3016f5442e28386ded73c43a32a5b68586dd1c4", - "reference": "a3016f5442e28386ded73c43a32a5b68586dd1c4", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/d28f02acde71ff75e957082cd36e973df395f626", + "reference": "d28f02acde71ff75e957082cd36e973df395f626", "shasum": "" }, "require": { @@ -4025,7 +4020,7 @@ "options" ], "support": { - "source": "https://github.com/symfony/options-resolver/tree/v6.1.0" + "source": "https://github.com/symfony/options-resolver/tree/v6.2.0" }, "funding": [ { @@ -4041,20 +4036,20 @@ "type": "tidelift" } ], - "time": "2022-02-25T11:15:52+00:00" + "time": "2022-11-02T09:08:04+00:00" }, { "name": "symfony/polyfill-ctype", - "version": "v1.26.0", + "version": "v1.27.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4" + "reference": "5bbc823adecdae860bb64756d639ecfec17b050a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4", - "reference": "6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/5bbc823adecdae860bb64756d639ecfec17b050a", + "reference": "5bbc823adecdae860bb64756d639ecfec17b050a", "shasum": "" }, "require": { @@ -4069,7 +4064,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.26-dev" + "dev-main": "1.27-dev" }, "thanks": { "name": "symfony/polyfill", @@ -4107,7 +4102,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.26.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.27.0" }, "funding": [ { @@ -4123,20 +4118,20 @@ "type": "tidelift" } ], - "time": "2022-05-24T11:49:31+00:00" + "time": "2022-11-03T14:55:06+00:00" }, { "name": "symfony/polyfill-intl-grapheme", - "version": "v1.26.0", + "version": "v1.27.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "433d05519ce6990bf3530fba6957499d327395c2" + "reference": "511a08c03c1960e08a883f4cffcacd219b758354" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/433d05519ce6990bf3530fba6957499d327395c2", - "reference": "433d05519ce6990bf3530fba6957499d327395c2", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/511a08c03c1960e08a883f4cffcacd219b758354", + "reference": "511a08c03c1960e08a883f4cffcacd219b758354", "shasum": "" }, "require": { @@ -4148,7 +4143,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.26-dev" + "dev-main": "1.27-dev" }, "thanks": { "name": "symfony/polyfill", @@ -4188,7 +4183,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.26.0" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.27.0" }, "funding": [ { @@ -4204,20 +4199,20 @@ "type": "tidelift" } ], - "time": "2022-05-24T11:49:31+00:00" + "time": "2022-11-03T14:55:06+00:00" }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.26.0", + "version": "v1.27.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "219aa369ceff116e673852dce47c3a41794c14bd" + "reference": "19bd1e4fcd5b91116f14d8533c57831ed00571b6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/219aa369ceff116e673852dce47c3a41794c14bd", - "reference": "219aa369ceff116e673852dce47c3a41794c14bd", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/19bd1e4fcd5b91116f14d8533c57831ed00571b6", + "reference": "19bd1e4fcd5b91116f14d8533c57831ed00571b6", "shasum": "" }, "require": { @@ -4229,7 +4224,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.26-dev" + "dev-main": "1.27-dev" }, "thanks": { "name": "symfony/polyfill", @@ -4272,7 +4267,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.26.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.27.0" }, "funding": [ { @@ -4288,20 +4283,20 @@ "type": "tidelift" } ], - "time": "2022-05-24T11:49:31+00:00" + "time": "2022-11-03T14:55:06+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.26.0", + "version": "v1.27.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e" + "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e", - "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/8ad114f6b39e2c98a8b0e3bd907732c207c2b534", + "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534", "shasum": "" }, "require": { @@ -4316,7 +4311,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.26-dev" + "dev-main": "1.27-dev" }, "thanks": { "name": "symfony/polyfill", @@ -4355,7 +4350,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.26.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.27.0" }, "funding": [ { @@ -4371,20 +4366,20 @@ "type": "tidelift" } ], - "time": "2022-05-24T11:49:31+00:00" + "time": "2022-11-03T14:55:06+00:00" }, { "name": "symfony/polyfill-php80", - "version": "v1.26.0", + "version": "v1.27.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "cfa0ae98841b9e461207c13ab093d76b0fa7bace" + "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/cfa0ae98841b9e461207c13ab093d76b0fa7bace", - "reference": "cfa0ae98841b9e461207c13ab093d76b0fa7bace", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", + "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", "shasum": "" }, "require": { @@ -4393,7 +4388,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.26-dev" + "dev-main": "1.27-dev" }, "thanks": { "name": "symfony/polyfill", @@ -4438,7 +4433,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.26.0" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.27.0" }, "funding": [ { @@ -4454,20 +4449,20 @@ "type": "tidelift" } ], - "time": "2022-05-10T07:21:04+00:00" + "time": "2022-11-03T14:55:06+00:00" }, { "name": "symfony/polyfill-php81", - "version": "v1.26.0", + "version": "v1.27.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php81.git", - "reference": "13f6d1271c663dc5ae9fb843a8f16521db7687a1" + "reference": "707403074c8ea6e2edaf8794b0157a0bfa52157a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/13f6d1271c663dc5ae9fb843a8f16521db7687a1", - "reference": "13f6d1271c663dc5ae9fb843a8f16521db7687a1", + "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/707403074c8ea6e2edaf8794b0157a0bfa52157a", + "reference": "707403074c8ea6e2edaf8794b0157a0bfa52157a", "shasum": "" }, "require": { @@ -4476,7 +4471,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.26-dev" + "dev-main": "1.27-dev" }, "thanks": { "name": "symfony/polyfill", @@ -4517,7 +4512,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php81/tree/v1.26.0" + "source": "https://github.com/symfony/polyfill-php81/tree/v1.27.0" }, "funding": [ { @@ -4533,20 +4528,20 @@ "type": "tidelift" } ], - "time": "2022-05-24T11:49:31+00:00" + "time": "2022-11-03T14:55:06+00:00" }, { "name": "symfony/process", - "version": "v6.1.0", + "version": "v6.2.0", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "318718453c2be58266f1a9e74063d13cb8dd4165" + "reference": "ba6e55359f8f755fe996c58a81e00eaa67a35877" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/318718453c2be58266f1a9e74063d13cb8dd4165", - "reference": "318718453c2be58266f1a9e74063d13cb8dd4165", + "url": "https://api.github.com/repos/symfony/process/zipball/ba6e55359f8f755fe996c58a81e00eaa67a35877", + "reference": "ba6e55359f8f755fe996c58a81e00eaa67a35877", "shasum": "" }, "require": { @@ -4578,7 +4573,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v6.1.0" + "source": "https://github.com/symfony/process/tree/v6.2.0" }, "funding": [ { @@ -4594,7 +4589,7 @@ "type": "tidelift" } ], - "time": "2022-05-11T12:12:29+00:00" + "time": "2022-11-02T09:08:04+00:00" }, { "name": "symfony/service-contracts", @@ -4683,16 +4678,16 @@ }, { "name": "symfony/stopwatch", - "version": "v6.1.0", + "version": "v6.2.0", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", - "reference": "77dedae82ce2a26e2e9b481855473fc3b3e4e54d" + "reference": "266636bb8f3fbdccc302491df7b3a1b9a8c238a7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/77dedae82ce2a26e2e9b481855473fc3b3e4e54d", - "reference": "77dedae82ce2a26e2e9b481855473fc3b3e4e54d", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/266636bb8f3fbdccc302491df7b3a1b9a8c238a7", + "reference": "266636bb8f3fbdccc302491df7b3a1b9a8c238a7", "shasum": "" }, "require": { @@ -4725,7 +4720,7 @@ "description": "Provides a way to profile code", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/stopwatch/tree/v6.1.0" + "source": "https://github.com/symfony/stopwatch/tree/v6.2.0" }, "funding": [ { @@ -4741,20 +4736,20 @@ "type": "tidelift" } ], - "time": "2022-02-25T11:15:52+00:00" + "time": "2022-09-28T16:00:52+00:00" }, { "name": "symfony/string", - "version": "v6.1.2", + "version": "v6.2.0", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "1903f2879875280c5af944625e8246d81c2f0604" + "reference": "145702685e0d12f81d755c71127bfff7582fdd36" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/1903f2879875280c5af944625e8246d81c2f0604", - "reference": "1903f2879875280c5af944625e8246d81c2f0604", + "url": "https://api.github.com/repos/symfony/string/zipball/145702685e0d12f81d755c71127bfff7582fdd36", + "reference": "145702685e0d12f81d755c71127bfff7582fdd36", "shasum": "" }, "require": { @@ -4770,6 +4765,7 @@ "require-dev": { "symfony/error-handler": "^5.4|^6.0", "symfony/http-client": "^5.4|^6.0", + "symfony/intl": "^6.2", "symfony/translation-contracts": "^2.0|^3.0", "symfony/var-exporter": "^5.4|^6.0" }, @@ -4810,7 +4806,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v6.1.2" + "source": "https://github.com/symfony/string/tree/v6.2.0" }, "funding": [ { @@ -4826,7 +4822,81 @@ "type": "tidelift" } ], - "time": "2022-06-26T16:35:04+00:00" + "time": "2022-11-30T17:13:47+00:00" + }, + { + "name": "symfony/var-exporter", + "version": "v6.2.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/var-exporter.git", + "reference": "8a3f442d48567a5447e984ce9e86875ed768304a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/var-exporter/zipball/8a3f442d48567a5447e984ce9e86875ed768304a", + "reference": "8a3f442d48567a5447e984ce9e86875ed768304a", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "require-dev": { + "symfony/var-dumper": "^5.4|^6.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\VarExporter\\": "" + }, + "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": "Allows exporting any serializable PHP data structure to plain PHP code", + "homepage": "https://symfony.com", + "keywords": [ + "clone", + "construct", + "export", + "hydrate", + "instantiate", + "lazy loading", + "proxy", + "serialize" + ], + "support": { + "source": "https://github.com/symfony/var-exporter/tree/v6.2.1" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2022-12-03T22:32:58+00:00" }, { "name": "theseer/tokenizer", @@ -4880,24 +4950,24 @@ }, { "name": "vimeo/psalm", - "version": "4.24.0", + "version": "5.2.0", "source": { "type": "git", "url": "https://github.com/vimeo/psalm.git", - "reference": "06dd975cb55d36af80f242561738f16c5f58264f" + "reference": "fb685a16df3050d4c18d8a4100fe83abe6458cba" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vimeo/psalm/zipball/06dd975cb55d36af80f242561738f16c5f58264f", - "reference": "06dd975cb55d36af80f242561738f16c5f58264f", + "url": "https://api.github.com/repos/vimeo/psalm/zipball/fb685a16df3050d4c18d8a4100fe83abe6458cba", + "reference": "fb685a16df3050d4c18d8a4100fe83abe6458cba", "shasum": "" }, "require": { "amphp/amp": "^2.4.2", "amphp/byte-stream": "^1.5", - "composer/package-versions-deprecated": "^1.8.0", + "composer/package-versions-deprecated": "^1.10.0", "composer/semver": "^1.4 || ^2.0 || ^3.0", - "composer/xdebug-handler": "^1.1 || ^2.0 || ^3.0", + "composer/xdebug-handler": "^2.0 || ^3.0", "dnoegel/php-xdg-base-dir": "^0.1.1", "ext-ctype": "*", "ext-dom": "*", @@ -4906,34 +4976,35 @@ "ext-mbstring": "*", "ext-simplexml": "*", "ext-tokenizer": "*", - "felixfbecker/advanced-json-rpc": "^3.0.3", - "felixfbecker/language-server-protocol": "^1.5", + "felixfbecker/advanced-json-rpc": "^3.1", + "felixfbecker/language-server-protocol": "^1.5.2", + "fidry/cpu-core-counter": "^0.4.0", "netresearch/jsonmapper": "^1.0 || ^2.0 || ^3.0 || ^4.0", "nikic/php-parser": "^4.13", "openlss/lib-array2xml": "^1.0", - "php": "^7.1|^8", - "sebastian/diff": "^3.0 || ^4.0", - "symfony/console": "^3.4.17 || ^4.1.6 || ^5.0 || ^6.0", - "symfony/polyfill-php80": "^1.25", - "webmozart/path-util": "^2.3" + "php": "^7.4 || ~8.0.0 || ~8.1.0 || ~8.2.0", + "sebastian/diff": "^4.0", + "symfony/console": "^4.1.6 || ^5.0 || ^6.0", + "symfony/filesystem": "^5.4 || ^6.0", + "symfony/polyfill-php80": "^1.25" }, "provide": { "psalm/psalm": "self.version" }, "require-dev": { - "bamarni/composer-bin-plugin": "^1.2", - "brianium/paratest": "^4.0||^6.0", + "bamarni/composer-bin-plugin": "^1.4", + "brianium/paratest": "^6.0", "ext-curl": "*", + "mockery/mockery": "^1.5", + "nunomaduro/mock-final-classes": "^1.1", "php-parallel-lint/php-parallel-lint": "^1.2", - "phpdocumentor/reflection-docblock": "^5", - "phpmyadmin/sql-parser": "5.1.0||dev-master", - "phpspec/prophecy": ">=1.9.0", - "phpunit/phpunit": "^9.0", - "psalm/plugin-phpunit": "^0.16", - "slevomat/coding-standard": "^7.0", - "squizlabs/php_codesniffer": "^3.5", - "symfony/process": "^4.3 || ^5.0 || ^6.0", - "weirdan/prophecy-shim": "^1.0 || ^2.0" + "phpstan/phpdoc-parser": "^1.6", + "phpunit/phpunit": "^9.5", + "psalm/plugin-mockery": "^1.1", + "psalm/plugin-phpunit": "^0.18", + "slevomat/coding-standard": "^8.4", + "squizlabs/php_codesniffer": "^3.6", + "symfony/process": "^4.4 || ^5.0 || ^6.0" }, "suggest": { "ext-curl": "In order to send data to shepherd", @@ -4949,17 +5020,14 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.x-dev", + "dev-master": "5.x-dev", + "dev-4.x": "4.x-dev", "dev-3.x": "3.x-dev", "dev-2.x": "2.x-dev", "dev-1.x": "1.x-dev" } }, "autoload": { - "files": [ - "src/functions.php", - "src/spl_object_id.php" - ], "psr-4": { "Psalm\\": "src/Psalm/" } @@ -4981,9 +5049,9 @@ ], "support": { "issues": "https://github.com/vimeo/psalm/issues", - "source": "https://github.com/vimeo/psalm/tree/4.24.0" + "source": "https://github.com/vimeo/psalm/tree/5.2.0" }, - "time": "2022-06-26T11:47:54+00:00" + "time": "2022-12-12T08:18:56+00:00" }, { "name": "webmozart/assert", @@ -5042,57 +5110,6 @@ "source": "https://github.com/webmozarts/assert/tree/1.11.0" }, "time": "2022-06-03T18:03:27+00:00" - }, - { - "name": "webmozart/path-util", - "version": "2.3.0", - "source": { - "type": "git", - "url": "https://github.com/webmozart/path-util.git", - "reference": "d939f7edc24c9a1bb9c0dee5cb05d8e859490725" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/webmozart/path-util/zipball/d939f7edc24c9a1bb9c0dee5cb05d8e859490725", - "reference": "d939f7edc24c9a1bb9c0dee5cb05d8e859490725", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "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.", - "support": { - "issues": "https://github.com/webmozart/path-util/issues", - "source": "https://github.com/webmozart/path-util/tree/2.3.0" - }, - "abandoned": "symfony/filesystem", - "time": "2015-12-17T08:42:14+00:00" } ], "aliases": [], diff --git a/src/Classes/Connector.php b/src/Classes/Connector.php index 59be50f..fc86b1d 100644 --- a/src/Classes/Connector.php +++ b/src/Classes/Connector.php @@ -28,18 +28,20 @@ class Connector extends Database { public PDO $DB; public array $CONFIG; - + /** - * @throws Exception + * Reads the config.json file and populates the CONFIG property with the settings + * + * @throws \Exception */ public function __construct() { - if (!file_exists(__DIR__ . '/../config.json')) { + if (!file_exists(__DIR__ . '../config.json')) { throw new Exception('Cant read settings file.', 500); } try { $this->CONFIG = json_decode( - file_get_contents(__DIR__ . '/../config.json'), + file_get_contents(__DIR__ . '../config.json'), true ); $this->assemble(); @@ -47,9 +49,11 @@ class Connector extends Database throw new Exception('Cant populate settings.', 500); } } - + /** - * @throws Exception + * > Tries to connect to the database + * + * @throws \Exception */ public function assemble() { diff --git a/src/Classes/CuteGrills.php b/src/Classes/CuteGrills.php index 92a7cf1..b73a072 100644 --- a/src/Classes/CuteGrills.php +++ b/src/Classes/CuteGrills.php @@ -25,6 +25,9 @@ class CuteGrills { public array $GRILLS; + /** + * Loads the list of grills, then redirects to a random grill + */ public function showGrills(): void { $this->loadGrills(); @@ -38,6 +41,9 @@ class CuteGrills } } + /** + * Loads the images from the `img/grills/` directory into the `GRILLS` array + */ public function loadGrills(): void { $this->GRILLS = array_slice(scandir('img/grills/'), 2); diff --git a/src/Classes/Database.php b/src/Classes/Database.php index dcb9b0d..d912f05 100644 --- a/src/Classes/Database.php +++ b/src/Classes/Database.php @@ -28,16 +28,25 @@ class Database { private PDO $DB; - public function setDB($DB): void + /** + * Sets the value of the DB variable. + * + * @param $DB PDO The database connection. + */ + public function setDB(PDO $DB): void { $this->DB = $DB; } - - + /** - * @throws Exception + * Checks if a file name exists in the database + * + * @param $name string The name of the file. + * + * @return int The number of rows that match the query. + * @throws \Exception */ - public function dbCheckNameExists($name): string + public function dbCheckNameExists(string $name): int { try { $q = $this->DB->prepare('SELECT COUNT(filename) FROM files WHERE filename = (:name)'); @@ -48,11 +57,15 @@ class Database throw new Exception('Cant check if name exists in DB.', 500); } } - + /** - * @throws Exception + * Checks if the file is blacklisted + * + * @param $FILE_INFO array An array containing the following: + * + * @throws \Exception */ - public function checkFileBlacklist($FILE_INFO): void + public function checkFileBlacklist(array $FILE_INFO): void { try { $q = $this->DB->prepare('SELECT hash, COUNT(*) AS count FROM blacklist WHERE hash = (:hash)'); @@ -66,11 +79,15 @@ class Database throw new Exception('Cant check blacklist DB.', 500); } } - + /** - * @throws Exception + * Checks if the file already exists in the database + * + * @param $hash string The hash of the file you want to check for. + * + * @throws \Exception */ - public function antiDupe($hash): bool | array | string + public function antiDupe(string $hash): bool | array | string { if (!$this->CONFIG['ANTI_DUPE']) { return true; @@ -92,11 +109,16 @@ class Database throw new Exception('Cant check for dupes in DB.', 500); } } - + /** - * @throws Exception + * Inserts a new file into the database + * + * @param $FILE_INFO array + * @param $fingerPrintInfo array + * + * @throws \Exception */ - public function newIntoDB($FILE_INFO, $fingerPrintInfo): void + public function newIntoDB(array $FILE_INFO, array $fingerPrintInfo): void { try { $q = $this->DB->prepare( @@ -116,7 +138,12 @@ class Database } - public function createRateLimit($fingerPrintInfo): void + /** + * Creates a new row in the database with the information provided + * + * @param $fingerPrintInfo array + */ + public function createRateLimit(array $fingerPrintInfo): void { $q = $this->DB->prepare( 'INSERT INTO timestamp (iphash, files, time)' . @@ -129,7 +156,14 @@ class Database $q->execute(); } - public function updateRateLimit($fCount, $iStamp, $fingerPrintInfo): void + /** + * Update the rate limit table with the new file count and timestamp + * + * @param $fCount int The number of files uploaded by the user. + * @param $iStamp boolean A boolean value that determines whether or not to update the timestamp. + * @param $fingerPrintInfo array An array containing the following keys: + */ + public function updateRateLimit(int $fCount, bool $iStamp, array $fingerPrintInfo): void { if ($iStamp) { $q = $this->DB->prepare( @@ -149,7 +183,15 @@ class Database - public function checkRateLimit($fingerPrintInfo): bool + /** + * Checks if the user has uploaded more than 100 files in the last minute, if so it returns true, if not it updates the database with the new file count and + * timestamp + * + * @param $fingerPrintInfo array An array containing the following: + * + * @return bool A boolean value. + */ + public function checkRateLimit(array $fingerPrintInfo): bool { $q = $this->DB->prepare( 'SELECT files, time, iphash, COUNT(*) AS count FROM ratelimit WHERE iphash = (:iphash)' diff --git a/src/Classes/Response.php b/src/Classes/Response.php index 17b216c..b149137 100644 --- a/src/Classes/Response.php +++ b/src/Classes/Response.php @@ -25,7 +25,12 @@ class Response { public mixed $type; - public function __construct($response_type = "json") + /** + * Takes a string as an argument and sets the header to the appropriate content type + * + * @param $response_type string The type of response you want to return. Valid options are: csv, html, json, text. + */ + public function __construct(string $response_type = "json") { switch ($response_type) { case 'csv': @@ -56,7 +61,13 @@ class Response } } - public function error($code, $desc): void + /** + * Returns a string based on the type of response requested + * + * @param $code mixed The HTTP status code to return. + * @param $desc string The description of the error. + */ + public function error(mixed $code, string $desc): void { $response = match ($this->type) { 'csv' => $this->csvError($desc), @@ -68,17 +79,34 @@ class Response echo $response; } - private static function csvError($description): string + /* Returning a string that contains the error message. */ + private static function csvError(string $description): string { return '"error"' . "\r\n" . "\"$description\"" . "\r\n"; } - private static function htmlError($code, $description): string + /** + * Returns a string containing an HTML paragraph element with the error code and description + * + * @param $code int|string The error code. + * @param $description string The description of the error. + * + * @return string A string. + */ + private static function htmlError(int|string $code, string $description): string { return '

ERROR: (' . $code . ') ' . $description . '

'; } - private static function jsonError($code, $description): bool|string + /** + * Returns a JSON string with the error code and description + * + * @param $code int|string The error code. + * @param $description string The description of the error. + * + * @return bool|string A JSON string + */ + private static function jsonError(int|string $code, string $description): bool|string { return json_encode([ 'success' => false, @@ -88,12 +116,27 @@ class Response } - private static function textError($code, $description): string + /** + * Returns a string that contains the error code and description + * + * @param $code int|string The error code. + * @param $description string The description of the error. + * + * @return string A string with the error code and description. + */ + private static function textError(int|string $code, string $description): string { return 'ERROR: (' . $code . ') ' . $description; } - public function send($files): void + /** + * "If the type is csv, then call the csvSuccess function, if the type is html, then call the htmlSuccess function, etc." + * + * The `match` keyword is a new feature in PHP 8. It's a lot like a switch statement, but it's more powerful + * + * @param $files array An array of file objects. + */ + public function send(array $files): void { $response = match ($this->type) { 'csv' => $this->csvSuccess($files), @@ -106,7 +149,14 @@ class Response echo $response; } - private static function csvSuccess($files): string + /** + * Takes an array of files and returns a CSV string + * + * @param $files array An array of files that have been uploaded. + * + * @return string A string of the files in the array. + */ + private static function csvSuccess(array $files): string { $result = '"name","url","hash","size"' . "\r\n"; foreach ($files as $file) { @@ -119,7 +169,14 @@ class Response return $result; } - private static function htmlSuccess($files): string + /** + * Takes an array of files and returns a string of HTML links + * + * @param $files array An array of files to be uploaded. + * + * @return string the result of the foreach loop. + */ + private static function htmlSuccess(array $files): string { $result = ''; @@ -130,7 +187,14 @@ class Response return $result; } - private static function jsonSuccess($files): bool|string + /** + * Returns a JSON string that contains a success message and the files that were uploaded + * + * @param $files array The files to be uploaded. + * + * @return bool|string A JSON string + */ + private static function jsonSuccess(array $files): bool|string { return json_encode([ 'success' => true, @@ -138,7 +202,14 @@ class Response ], JSON_PRETTY_PRINT); } - private static function textSuccess($files): string + /** + * Takes an array of files and returns a string of URLs + * + * @param $files array The files to be uploaded. + * + * @return string the url of the file. + */ + private static function textSuccess(array $files): string { $result = ''; diff --git a/src/Classes/Upload.php b/src/Classes/Upload.php index 17e79f8..c050aea 100644 --- a/src/Classes/Upload.php +++ b/src/Classes/Upload.php @@ -28,12 +28,16 @@ class Upload extends Response public array $FILE_INFO; public array $fingerPrintInfo; private mixed $Connector; - - + /** - * @throws Exception + * Takes an array of files, and returns an array of arrays containing the file's temporary name, name, size, SHA1 hash, extension, and MIME type + * + * @param $files array The files array from the $_FILES superglobal. + * + * @return array An array of arrays. + * @throws \Exception */ - public function reFiles($files): array + public function reFiles(array $files): array { $this->Connector = new Connector(); $this->Connector->setDB($this->Connector->DB); @@ -61,7 +65,34 @@ class Upload extends Response } return $result; } - public function diverseArray($files): array + /** + * Takes an array of arrays and returns an array of arrays with the keys and values swapped + * + * @param $files array an array of arrays + * + * @return array ``` + * array:2 [▼ + * 0 => array:2 [▼ + * 'TEMP_NAME' => 'example' + * 'NAME' => 'example' + * 'SIZE' => 'example' + * 'SHA1' => 'example' + * 'EXTENSION' => 'example' + * 'MIME' => 'example' + * + * ] + * 1 => array:2 [▼ + * 'TEMP_NAME' => 'example' + * 'NAME' => 'example' + * 'SIZE' => 'example' + * 'SHA1' => 'example' + * 'EXTENSION' => 'example' + * 'MIME' => 'example' + * ] + * ] + * ``` + */ + public function diverseArray(array $files): array { $result = []; foreach ($files as $key1 => $value1) { @@ -71,9 +102,12 @@ class Upload extends Response } return $result; } - + /** - * @throws Exception + * Takes a file, checks if it's blacklisted, moves it to the file storage, and then logs it to the database + * + * @return array An array containing the hash, name, url, and size of the file. + * @throws \Exception */ public function uploadFile(): array { @@ -123,26 +157,52 @@ class Upload extends Response 'size' => $this->FILE_INFO['SIZE'] ]; } - - public function fingerPrint($files_amount): void + + /** + * Takes the amount of files that are being uploaded, and creates a fingerprint of the user's IP address, user agent, and the amount of files being uploaded + * + * @param $files_amount int The amount of files that are being uploaded. + * + * @throws \Exception + */ + public function fingerPrint(int $files_amount): void { - $this->fingerPrintInfo = [ - 'timestamp' => time(), - 'useragent' => $_SERVER['HTTP_USER_AGENT'], - 'ip' => $_SERVER['REMOTE_ADDR'], - 'ip_hash' => hash('sha1', $_SERVER['REMOTE_ADDR'] . $_SERVER['HTTP_USER_AGENT']), - 'files_amount' => $files_amount - ]; + if (!empty($_SERVER['HTTP_USER_AGENT'])) { + $USER_AGENT = filter_var($_SERVER['HTTP_USER_AGENT'], FILTER_SANITIZE_ENCODED); + $this->fingerPrintInfo = [ + 'timestamp' => time(), + 'useragent' => $USER_AGENT, + 'ip' => $_SERVER['REMOTE_ADDR'], + 'ip_hash' => hash('sha1', $_SERVER['REMOTE_ADDR'] . $USER_AGENT), + 'files_amount' => $files_amount + ]; + } else { + throw new Exception('Invalid user agent.', 500); + } } - public function fileMIME($file): string + /** + * Returns the MIME type of a file + * + * @param $file array The file to be checked. + * + * @return string The MIME type of the file. + */ + public function fileMIME(array $file): string { - $finfo = finfo_open(FILEINFO_MIME_TYPE); - return finfo_file($finfo, $file['tmp_name']); + $FILE_INFO = finfo_open(FILEINFO_MIME_TYPE); + return finfo_file($FILE_INFO, $file['tmp_name']); } - public function fileExtension($file): ?string + /** + * Takes a file and returns the file extension + * + * @param $file array The file you want to get the extension from. + * + * @return ?string The file extension of the file. + */ + public function fileExtension(array $file): ?string { $extension = explode('.', $file['name']); if (substr_count($file['name'], '.') > 0) { @@ -151,10 +211,11 @@ class Upload extends Response return null; } } - - + /** - * @throws Exception + * > Check if the file's MIME type is in the blacklist + * + * @throws \Exception */ public function checkMimeBlacklist(): void { @@ -162,12 +223,11 @@ class Upload extends Response throw new Exception('Filetype not allowed.', 415); } } - + /** - * Check if file extension is blacklisted - * if it does throw an exception. + * > Check if the file extension is in the blacklist * - * @throws Exception + * @throws \Exception */ public function checkExtensionBlacklist(): void { @@ -175,14 +235,19 @@ class Upload extends Response throw new Exception('Filetype not allowed.', 415); } } - + /** - * @throws Exception + * Generates a random string of characters, checks if it exists in the database, and if it does, it generates another one + * + * @param $extension string The file extension. + * @param $hash string The hash of the file. + * + * @return string A string + * @throws \Exception */ - public function generateName($extension, $hash): string + public function generateName(string $extension, string $hash): string { - $a = $this->Connector->antiDupe($hash); - if ($a === true) { + if ($this->Connector->antiDupe($hash)) { do { if ($this->Connector->CONFIG['FILES_RETRIES'] === 0) { throw new Exception('Gave up trying to find an unused name!', 500); @@ -194,13 +259,13 @@ class Upload extends Response [mt_rand(0, strlen($this->Connector->CONFIG['ID_CHARSET']))]; } - if (!is_null($extension)) { + if (!empty($extension)) { $NEW_NAME .= '.' . $extension; } } while ($this->Connector->dbCheckNameExists($NEW_NAME) > 0); return $NEW_NAME; } else { - return $a; + return $this->Connector->antiDupe($hash); } } } diff --git a/src/UploadGateway.php b/src/UploadGateway.php index 7791093..eb67550 100644 --- a/src/UploadGateway.php +++ b/src/UploadGateway.php @@ -1,53 +1,61 @@ - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -namespace Pomf\Uguu; - -use Exception; -use Pomf\Uguu\Classes\Response; - -class UploadGateway extends Classes\Upload -{ /** - * @throws Exception + * Uguu + * + * @copyright Copyright (c) 2022 Go Johansson (nokonoko) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . */ - public function handleFile($output, $files) + + namespace Pomf\Uguu; + + use Exception; + use Pomf\Uguu\Classes\Response; + + class UploadGateway extends Classes\Upload { - $type = $output ?? 'json'; - $response = (new Response($type)); - if (isset($_FILES['files'])) { - $files = $this->reFiles($files); - try { - $this->fingerPrint(count($files)); - foreach ($files as $ignored) { - $res[] = $this->uploadFile(); + /** + * It handles the file uploads. + * + * @param $output mixed The output format of the response. + * @param $files mixed The name of the file input field. + * + * @throws \Exception + */ + public function handleFile(mixed $output, mixed $files) + { + $type = 'json' ?? $output; + $response = (new Response($type)); + if (!empty($_FILES['files'])) { + + $files = $this->reFiles($files); + try { + $this->fingerPrint(count($files)); + $res = []; + foreach ($files as $ignored) { + $res[] = $this->uploadFile(); + } + if (!empty($res)) { + $response->send($res); + } } - if (isset($res)) { - $response->send($res); + catch (Exception $e) { + $response->error($e->getCode(), $e->getMessage()); } - } catch (Exception $e) { - $response->error($e->getCode(), $e->getMessage()); + + } else { + $response->error(400, 'No input file(s)'); } - } else { - $response->error(400, 'No input file(s)'); } - } -} + } \ No newline at end of file diff --git a/src/static/php/upload.php b/src/static/php/upload.php index 6151e04..a2cb519 100644 --- a/src/static/php/upload.php +++ b/src/static/php/upload.php @@ -25,9 +25,8 @@ require_once __DIR__ . '/../vendor/autoload.php'; use Pomf\Uguu\UploadGateway; -$Upload = new UploadGateway(); try { - $Upload->handleFile($_GET['output'], $_FILES['files']); + (new UploadGateway())->handleFile($_GET['output'], $_FILES['files']); } catch (Exception $e) { throw new Exception($e->getMessage(), 500); }