diff --git a/.env.testing.tric b/.env.testing.slic similarity index 100% rename from .env.testing.tric rename to .env.testing.slic diff --git a/.github/workflows/tests-php.yml b/.github/workflows/tests-php.yml index 8723436..1fb7867 100644 --- a/.github/workflows/tests-php.yml +++ b/.github/workflows/tests-php.yml @@ -15,14 +15,14 @@ jobs: fetch-depth: 1000 submodules: recursive # ------------------------------------------------------------------------------ - # Checkout tric + # Checkout slic # ------------------------------------------------------------------------------ - - name: Checkout tric + - name: Checkout slic uses: actions/checkout@v2 with: - repository: the-events-calendar/tric + repository: stellarwp/slic ref: main - path: tric + path: slic fetch-depth: 1 # ------------------------------------------------------------------------------ # Prepare our composer cache directory @@ -39,35 +39,35 @@ jobs: restore-keys: | ${{ runner.os }}-composer- # ------------------------------------------------------------------------------ - # Initialize tric + # Initialize slic # ------------------------------------------------------------------------------ - - name: Set up tric env vars + - name: Set up slic env vars run: | - echo "TRIC_BIN=${GITHUB_WORKSPACE}/tric/tric" >> $GITHUB_ENV - echo "TRIC_WP_DIR=${GITHUB_WORKSPACE}/tric/_wordpress" >> $GITHUB_ENV - echo "TRIC_WORDPRESS_DOCKERFILE=Dockerfile.base" >> $GITHUB_ENV - - name: Set run context for tric - run: echo "TRIC=1" >> $GITHUB_ENV && echo "CI=1" >> $GITHUB_ENV + echo "SLIC_BIN=${GITHUB_WORKSPACE}/slic/slic" >> $GITHUB_ENV + echo "SLIC_WP_DIR=${GITHUB_WORKSPACE}/slic/_wordpress" >> $GITHUB_ENV + echo "SLIC_WORDPRESS_DOCKERFILE=Dockerfile.base" >> $GITHUB_ENV + - name: Set run context for slic + run: echo "SLIC=1" >> $GITHUB_ENV && echo "CI=1" >> $GITHUB_ENV - name: Start ssh-agent run: | mkdir -p "${HOME}/.ssh"; ssh-agent -a /tmp/ssh_agent.sock; - name: Export SSH_AUTH_SOCK env var run: echo "SSH_AUTH_SOCK=/tmp/ssh_agent.sock" >> $GITHUB_ENV - - name: Set up tric for CI + - name: Set up slic for CI run: | cd ${GITHUB_WORKSPACE}/.. - ${TRIC_BIN} here - ${TRIC_BIN} interactive off - ${TRIC_BIN} build-prompt off - ${TRIC_BIN} build-subdir off - ${TRIC_BIN} xdebug off - ${TRIC_BIN} debug on - ${TRIC_BIN} info - ${TRIC_BIN} config + ${SLIC_BIN} here + ${SLIC_BIN} interactive off + ${SLIC_BIN} build-prompt off + ${SLIC_BIN} build-subdir off + ${SLIC_BIN} xdebug off + ${SLIC_BIN} debug on + ${SLIC_BIN} info + ${SLIC_BIN} config - name: Set up StellarWP DB run: | - ${TRIC_BIN} use db - ${TRIC_BIN} composer install --ignore-platform-reqs + ${SLIC_BIN} use db + ${SLIC_BIN} composer install --ignore-platform-reqs - name: Run suite wpunit - run: ${TRIC_BIN} run ${{ matrix.suite }} --ext DotReporter + run: ${SLIC_BIN} run ${{ matrix.suite }} --ext DotReporter diff --git a/README.md b/README.md index b4d9949..6918c5c 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,10 @@ composer require stellarwp/db ## Table of contents +- [Quick start](#quick-start) + +- [Configuration](#configuration) + - [DB](#db) - [Select statements](#select-statements) @@ -65,6 +69,50 @@ composer require stellarwp/db - [Min](#min) - [Max](#max) +## Quick start + +Getting up and running with this library is easy. You'll want to initialize the `DB` class. Doing so during the `plugins_loaded` action is a reasonable location, though you can do it anywhere that feels appropriate. + +_For this example and all future ones, let's assume you have [included this library with Strauss](https://github.com/stellarwp/global-docs/blob/main/docs/strauss-setup.md) and your project's namespace is `Boom\Shakalaka`._ + +```php +use Boom\Shakalaka\StellarWP\DB\DB; + +add_action( 'plugins_loaded', function() { + DB::init(); +}, 0 ); +``` + +The two main classes that make up the core of this library are the `DB` class and the `QueryBuilder` class. Here are their namespaces: + +```php +# For DB, it is "StellarWP\DB\DB", but with your namespace prefix it'll be: +use Boom\Shakalaka\StellarWP\DB\DB; + +# For QueryBuilder, it is "StellarWP\DB\QueryBuilder\QueryBuilder", but with your namespace prefix it'll be: +use Boom\Shakalaka\StellarWP\DB\QueryBuilder\QueryBuilder; +``` + +## Configuration + +This library provides default hooks and exceptions, however, if you have additional needs for your own application, you can override one or both via the `StellarWP\DB\Config` class: + +```php +use Boom\Shakalaka\StellarWP\DB\Config; + +// Ensure hooks are prefixed with your project's prefix. +Config::setHookPrefix( 'boom_shakalaka' ); + +// Use your own exception class rather than the default Database\Exceptions\DatabaseQueryException class. +Config::setDatabaseQueryException( 'MyCustomException' ); + +// Fetch the hook prefix. +$prefix = Config::getHookPrefix(); + +// Fetch the database query exception class. +$class = Config::getDatabaseQueryException(); +``` + ## DB `DB` class is a static decorator for the `$wpdb` class, but it has a few methods that are exceptions to that. diff --git a/codeception.tric.yml b/codeception.slic.yml similarity index 75% rename from codeception.tric.yml rename to codeception.slic.yml index 8a383c7..9bcf605 100644 --- a/codeception.tric.yml +++ b/codeception.slic.yml @@ -1,3 +1,3 @@ params: # read dynamic configuration parameters from the .env file - - .env.testing.tric + - .env.testing.slic diff --git a/composer.json b/composer.json index b982088..6ad615b 100644 --- a/composer.json +++ b/composer.json @@ -20,9 +20,7 @@ } ], "minimum-stability": "stable", - "require": { - "lucatume/di52": "^3.0" - }, + "require": {}, "require-dev": { "codeception/module-asserts": "^1.0", "codeception/module-cli": "^1.0", diff --git a/composer.lock b/composer.lock index f3cd934..94433ff 100644 --- a/composer.lock +++ b/composer.lock @@ -4,97 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "be30bdcb08d7290aba934f26408da912", - "packages": [ - { - "name": "lucatume/di52", - "version": "3.0.0", - "source": { - "type": "git", - "url": "https://github.com/lucatume/di52.git", - "reference": "5af2320885de6fa352dbaeecba87cd8df16d6db1" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/lucatume/di52/zipball/5af2320885de6fa352dbaeecba87cd8df16d6db1", - "reference": "5af2320885de6fa352dbaeecba87cd8df16d6db1", - "shasum": "" - }, - "require": { - "ext-json": "*", - "php": ">=5.6", - "psr/container": "^1.0" - }, - "require-dev": { - "phpunit/phpunit": "*" - }, - "type": "library", - "autoload": { - "files": [ - "aliases.php" - ], - "psr-4": { - "lucatume\\DI52\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "GPL-3.0" - ], - "authors": [ - { - "name": "Luca Tumedei", - "email": "luca@theaveragedev.com" - } - ], - "description": "A PHP 5.2 compatible dependency injection container.", - "time": "2022-02-09T16:16:09+00:00" - }, - { - "name": "psr/container", - "version": "1.1.2", - "source": { - "type": "git", - "url": "https://github.com/php-fig/container.git", - "reference": "513e0666f7216c7459170d56df27dfcefe1689ea" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/513e0666f7216c7459170d56df27dfcefe1689ea", - "reference": "513e0666f7216c7459170d56df27dfcefe1689ea", - "shasum": "" - }, - "require": { - "php": ">=7.4.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Psr\\Container\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "description": "Common Container Interface (PHP FIG PSR-11)", - "homepage": "https://github.com/php-fig/container", - "keywords": [ - "PSR-11", - "container", - "container-interface", - "container-interop", - "psr" - ], - "time": "2021-11-05T16:50:12+00:00" - } - ], + "content-hash": "5ca726ae48f8ce29b6b2871398e7b472", + "packages": [], "packages-dev": [ { "name": "antecedent/patchwork", @@ -138,6 +49,10 @@ "runkit", "testing" ], + "support": { + "issues": "https://github.com/antecedent/patchwork/issues", + "source": "https://github.com/antecedent/patchwork/tree/2.1.21" + }, "time": "2022-02-07T07:28:34+00:00" }, { @@ -197,6 +112,10 @@ "gherkin", "parser" ], + "support": { + "issues": "https://github.com/Behat/Gherkin/issues", + "source": "https://github.com/Behat/Gherkin/tree/v4.9.0" + }, "time": "2021-10-12T13:05:09+00:00" }, { @@ -249,6 +168,10 @@ "password", "security" ], + "support": { + "issues": "https://github.com/bordoni/phpass/issues", + "source": "https://github.com/bordoni/phpass/tree/0.3.6" + }, "time": "2012-08-31T00:00:00+00:00" }, { @@ -337,6 +260,10 @@ "functional testing", "unit testing" ], + "support": { + "issues": "https://github.com/Codeception/Codeception/issues", + "source": "https://github.com/Codeception/Codeception/tree/4.2.2" + }, "funding": [ { "url": "https://opencollective.com/codeception", @@ -393,6 +320,10 @@ "keywords": [ "codeception" ], + "support": { + "issues": "https://github.com/Codeception/lib-asserts/issues", + "source": "https://github.com/Codeception/lib-asserts/tree/1.13.2" + }, "time": "2020-10-21T16:26:20+00:00" }, { @@ -449,6 +380,10 @@ "keywords": [ "codeception" ], + "support": { + "issues": "https://github.com/Codeception/lib-innerbrowser/issues", + "source": "https://github.com/Codeception/lib-innerbrowser/tree/1.5.1" + }, "time": "2021-08-30T15:21:42+00:00" }, { @@ -502,6 +437,10 @@ "asserts", "codeception" ], + "support": { + "issues": "https://github.com/Codeception/module-asserts/issues", + "source": "https://github.com/Codeception/module-asserts/tree/1.3.1" + }, "time": "2020-10-21T16:48:15+00:00" }, { @@ -545,6 +484,10 @@ "keywords": [ "codeception" ], + "support": { + "issues": "https://github.com/Codeception/module-cli/issues", + "source": "https://github.com/Codeception/module-cli/tree/1.1.1" + }, "time": "2020-12-26T16:56:19+00:00" }, { @@ -593,6 +536,10 @@ "database-testing", "db-testing" ], + "support": { + "issues": "https://github.com/Codeception/module-db/issues", + "source": "https://github.com/Codeception/module-db/tree/1.2.0" + }, "time": "2022-03-05T19:38:40+00:00" }, { @@ -641,6 +588,10 @@ "codeception", "filesystem" ], + "support": { + "issues": "https://github.com/Codeception/module-filesystem/issues", + "source": "https://github.com/Codeception/module-filesystem/tree/1.0.3" + }, "time": "2020-10-24T14:46:40+00:00" }, { @@ -697,6 +648,10 @@ "functional-testing", "http" ], + "support": { + "issues": "https://github.com/Codeception/module-phpbrowser/issues", + "source": "https://github.com/Codeception/module-phpbrowser/tree/1.0.3" + }, "time": "2022-05-21T13:50:41+00:00" }, { @@ -747,20 +702,24 @@ "codeception", "rest" ], + "support": { + "issues": "https://github.com/Codeception/module-rest/issues", + "source": "https://github.com/Codeception/module-rest/tree/1.4.2" + }, "time": "2021-11-18T18:58:15+00:00" }, { "name": "codeception/module-webdriver", - "version": "1.4.0", + "version": "1.4.1", "source": { "type": "git", "url": "https://github.com/Codeception/module-webdriver.git", - "reference": "baa18b7bf70aa024012f967b5ce5021e1faa9151" + "reference": "e22ac7da756df659df6dd4fac2dff9c859e30131" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Codeception/module-webdriver/zipball/baa18b7bf70aa024012f967b5ce5021e1faa9151", - "reference": "baa18b7bf70aa024012f967b5ce5021e1faa9151", + "url": "https://api.github.com/repos/Codeception/module-webdriver/zipball/e22ac7da756df659df6dd4fac2dff9c859e30131", + "reference": "e22ac7da756df659df6dd4fac2dff9c859e30131", "shasum": "" }, "require": { @@ -799,7 +758,11 @@ "browser-testing", "codeception" ], - "time": "2021-09-02T12:01:02+00:00" + "support": { + "issues": "https://github.com/Codeception/module-webdriver/issues", + "source": "https://github.com/Codeception/module-webdriver/tree/1.4.1" + }, + "time": "2022-09-12T05:09:51+00:00" }, { "name": "codeception/phpunit-wrapper", @@ -842,6 +805,10 @@ } ], "description": "PHPUnit classes used by Codeception", + "support": { + "issues": "https://github.com/Codeception/phpunit-wrapper/issues", + "source": "https://github.com/Codeception/phpunit-wrapper/tree/6.8.4" + }, "time": "2022-05-23T05:56:13+00:00" }, { @@ -873,6 +840,10 @@ "MIT" ], "description": "Flexible Stub wrapper for PHPUnit's Mock Builder", + "support": { + "issues": "https://github.com/Codeception/Stub/issues", + "source": "https://github.com/Codeception/Stub/tree/master" + }, "time": "2019-08-10T16:20:53+00:00" }, { @@ -906,6 +877,10 @@ ], "description": "Mock framework module used in internal Codeception tests", "homepage": "http://codeception.com/", + "support": { + "issues": "https://github.com/Codeception/util-universalframework/issues", + "source": "https://github.com/Codeception/util-universalframework/tree/1.0.0" + }, "time": "2019-09-22T06:06:49+00:00" }, { @@ -946,32 +921,35 @@ "keywords": [ "mysql" ], + "support": { + "source": "https://github.com/dg/MySQL-dump/tree/master" + }, "time": "2019-09-10T21:36:25+00:00" }, { "name": "doctrine/inflector", - "version": "2.0.4", + "version": "2.0.5", "source": { "type": "git", "url": "https://github.com/doctrine/inflector.git", - "reference": "8b7ff3e4b7de6b2c84da85637b59fd2880ecaa89" + "reference": "ade2b3bbfb776f27f0558e26eed43b5d9fe1b392" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/inflector/zipball/8b7ff3e4b7de6b2c84da85637b59fd2880ecaa89", - "reference": "8b7ff3e4b7de6b2c84da85637b59fd2880ecaa89", + "url": "https://api.github.com/repos/doctrine/inflector/zipball/ade2b3bbfb776f27f0558e26eed43b5d9fe1b392", + "reference": "ade2b3bbfb776f27f0558e26eed43b5d9fe1b392", "shasum": "" }, "require": { "php": "^7.2 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "^8.2", - "phpstan/phpstan": "^0.12", - "phpstan/phpstan-phpunit": "^0.12", - "phpstan/phpstan-strict-rules": "^0.12", - "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0", - "vimeo/psalm": "^4.10" + "doctrine/coding-standard": "^9", + "phpstan/phpstan": "^1.8", + "phpstan/phpstan-phpunit": "^1.1", + "phpstan/phpstan-strict-rules": "^1.3", + "phpunit/phpunit": "^8.5 || ^9.5", + "vimeo/psalm": "^4.25" }, "type": "library", "autoload": { @@ -1019,6 +997,10 @@ "uppercase", "words" ], + "support": { + "issues": "https://github.com/doctrine/inflector/issues", + "source": "https://github.com/doctrine/inflector/tree/2.0.5" + }, "funding": [ { "url": "https://www.doctrine-project.org/sponsorship.html", @@ -1033,7 +1015,7 @@ "type": "tidelift" } ], - "time": "2021-10-22T20:16:43+00:00" + "time": "2022-09-07T09:01:28+00:00" }, { "name": "doctrine/instantiator", @@ -1085,6 +1067,10 @@ "constructor", "instantiate" ], + "support": { + "issues": "https://github.com/doctrine/instantiator/issues", + "source": "https://github.com/doctrine/instantiator/tree/1.4.1" + }, "funding": [ { "url": "https://www.doctrine-project.org/sponsorship.html", @@ -1103,16 +1089,16 @@ }, { "name": "guzzlehttp/guzzle", - "version": "7.4.5", + "version": "7.5.0", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "1dd98b0564cb3f6bd16ce683cb755f94c10fbd82" + "reference": "b50a2a1251152e43f6a37f0fa053e730a67d25ba" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/1dd98b0564cb3f6bd16ce683cb755f94c10fbd82", - "reference": "1dd98b0564cb3f6bd16ce683cb755f94c10fbd82", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/b50a2a1251152e43f6a37f0fa053e730a67d25ba", + "reference": "b50a2a1251152e43f6a37f0fa053e730a67d25ba", "shasum": "" }, "require": { @@ -1127,10 +1113,10 @@ "psr/http-client-implementation": "1.0" }, "require-dev": { - "bamarni/composer-bin-plugin": "^1.4.1", + "bamarni/composer-bin-plugin": "^1.8.1", "ext-curl": "*", "php-http/client-integration-tests": "^3.0", - "phpunit/phpunit": "^8.5.5 || ^9.3.5", + "phpunit/phpunit": "^8.5.29 || ^9.5.23", "psr/log": "^1.1 || ^2.0 || ^3.0" }, "suggest": { @@ -1140,8 +1126,12 @@ }, "type": "library", "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + }, "branch-alias": { - "dev-master": "7.4-dev" + "dev-master": "7.5-dev" } }, "autoload": { @@ -1205,6 +1195,10 @@ "rest", "web service" ], + "support": { + "issues": "https://github.com/guzzle/guzzle/issues", + "source": "https://github.com/guzzle/guzzle/tree/7.5.0" + }, "funding": [ { "url": "https://github.com/GrahamCampbell", @@ -1219,20 +1213,20 @@ "type": "tidelift" } ], - "time": "2022-06-20T22:16:13+00:00" + "time": "2022-08-28T15:39:27+00:00" }, { "name": "guzzlehttp/promises", - "version": "1.5.1", + "version": "1.5.2", "source": { "type": "git", "url": "https://github.com/guzzle/promises.git", - "reference": "fe752aedc9fd8fcca3fe7ad05d419d32998a06da" + "reference": "b94b2807d85443f9719887892882d0329d1e2598" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/fe752aedc9fd8fcca3fe7ad05d419d32998a06da", - "reference": "fe752aedc9fd8fcca3fe7ad05d419d32998a06da", + "url": "https://api.github.com/repos/guzzle/promises/zipball/b94b2807d85443f9719887892882d0329d1e2598", + "reference": "b94b2807d85443f9719887892882d0329d1e2598", "shasum": "" }, "require": { @@ -1285,6 +1279,10 @@ "keywords": [ "promise" ], + "support": { + "issues": "https://github.com/guzzle/promises/issues", + "source": "https://github.com/guzzle/promises/tree/1.5.2" + }, "funding": [ { "url": "https://github.com/GrahamCampbell", @@ -1299,20 +1297,20 @@ "type": "tidelift" } ], - "time": "2021-10-22T20:56:57+00:00" + "time": "2022-08-28T14:55:35+00:00" }, { "name": "guzzlehttp/psr7", - "version": "2.4.0", + "version": "2.4.1", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "13388f00956b1503577598873fffb5ae994b5737" + "reference": "69568e4293f4fa993f3b0e51c9723e1e17c41379" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/13388f00956b1503577598873fffb5ae994b5737", - "reference": "13388f00956b1503577598873fffb5ae994b5737", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/69568e4293f4fa993f3b0e51c9723e1e17c41379", + "reference": "69568e4293f4fa993f3b0e51c9723e1e17c41379", "shasum": "" }, "require": { @@ -1326,15 +1324,19 @@ "psr/http-message-implementation": "1.0" }, "require-dev": { - "bamarni/composer-bin-plugin": "^1.4.1", + "bamarni/composer-bin-plugin": "^1.8.1", "http-interop/http-factory-tests": "^0.9", - "phpunit/phpunit": "^8.5.8 || ^9.3.10" + "phpunit/phpunit": "^8.5.29 || ^9.5.23" }, "suggest": { "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" }, "type": "library", "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + }, "branch-alias": { "dev-master": "2.4-dev" } @@ -1396,6 +1398,10 @@ "uri", "url" ], + "support": { + "issues": "https://github.com/guzzle/psr7/issues", + "source": "https://github.com/guzzle/psr7/tree/2.4.1" + }, "funding": [ { "url": "https://github.com/GrahamCampbell", @@ -1410,7 +1416,7 @@ "type": "tidelift" } ], - "time": "2022-06-20T21:43:11+00:00" + "time": "2022-08-28T14:45:39+00:00" }, { "name": "illuminate/collections", @@ -1460,6 +1466,10 @@ ], "description": "The Illuminate Collections package.", "homepage": "https://laravel.com", + "support": { + "issues": "https://github.com/laravel/framework/issues", + "source": "https://github.com/laravel/framework" + }, "time": "2022-06-23T15:29:49+00:00" }, { @@ -1504,6 +1514,10 @@ ], "description": "The Illuminate Contracts package.", "homepage": "https://laravel.com", + "support": { + "issues": "https://github.com/laravel/framework/issues", + "source": "https://github.com/laravel/framework" + }, "time": "2022-01-13T14:47:47+00:00" }, { @@ -1546,6 +1560,10 @@ ], "description": "The Illuminate Macroable package.", "homepage": "https://laravel.com", + "support": { + "issues": "https://github.com/laravel/framework/issues", + "source": "https://github.com/laravel/framework" + }, "time": "2021-11-16T13:57:03+00:00" }, { @@ -1610,6 +1628,10 @@ ], "description": "The Illuminate Support package.", "homepage": "https://laravel.com", + "support": { + "issues": "https://github.com/laravel/framework/issues", + "source": "https://github.com/laravel/framework" + }, "time": "2022-06-27T13:26:30+00:00" }, { @@ -1676,6 +1698,10 @@ "json", "schema" ], + "support": { + "issues": "https://github.com/justinrainbow/json-schema/issues", + "source": "https://github.com/justinrainbow/json-schema/tree/5.2.12" + }, "time": "2022-04-13T08:02:27+00:00" }, { @@ -1771,6 +1797,10 @@ "codeception", "wordpress" ], + "support": { + "issues": "https://github.com/lucatume/wp-browser/issues", + "source": "https://github.com/lucatume/wp-browser/tree/3.1.6" + }, "funding": [ { "url": "https://github.com/lucatume", @@ -1819,6 +1849,10 @@ "keywords": [ "shell" ], + "support": { + "issues": "https://github.com/mikehaertl/php-shellcommand/issues", + "source": "https://github.com/mikehaertl/php-shellcommand/tree/1.6.4" + }, "time": "2021-03-17T06:54:33+00:00" }, { @@ -1840,9 +1874,6 @@ "illuminate/support": ">=4.0.0", "php": ">=5.3.0" }, - "replace": { - "mikemclin/laravel-wp-password": "self.version" - }, "require-dev": { "mockery/mockery": "~0.9", "phpunit/phpunit": "~4.0", @@ -1883,6 +1914,10 @@ "password", "wordpress" ], + "support": { + "issues": "https://github.com/mikemclin/laravel-wp-password/issues", + "source": "https://github.com/mikemclin/laravel-wp-password/tree/2.0.3" + }, "time": "2021-09-30T13:48:57+00:00" }, { @@ -1929,6 +1964,10 @@ "mustache", "templating" ], + "support": { + "issues": "https://github.com/bobthecow/mustache.php/issues", + "source": "https://github.com/bobthecow/mustache.php/tree/v2.14.2" + }, "time": "2022-08-23T13:07:01+00:00" }, { @@ -1978,6 +2017,10 @@ "object", "object graph" ], + "support": { + "issues": "https://github.com/myclabs/DeepCopy/issues", + "source": "https://github.com/myclabs/DeepCopy/tree/1.11.0" + }, "funding": [ { "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", @@ -1988,16 +2031,16 @@ }, { "name": "nesbot/carbon", - "version": "2.61.0", + "version": "2.62.1", "source": { "type": "git", "url": "https://github.com/briannesbitt/Carbon.git", - "reference": "bdf4f4fe3a3eac4de84dbec0738082a862c68ba6" + "reference": "01bc4cdefe98ef58d1f9cb31bdbbddddf2a88f7a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/bdf4f4fe3a3eac4de84dbec0738082a862c68ba6", - "reference": "bdf4f4fe3a3eac4de84dbec0738082a862c68ba6", + "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/01bc4cdefe98ef58d1f9cb31bdbbddddf2a88f7a", + "reference": "01bc4cdefe98ef58d1f9cb31bdbbddddf2a88f7a", "shasum": "" }, "require": { @@ -2067,6 +2110,11 @@ "datetime", "time" ], + "support": { + "docs": "https://carbon.nesbot.com/docs", + "issues": "https://github.com/briannesbitt/Carbon/issues", + "source": "https://github.com/briannesbitt/Carbon" + }, "funding": [ { "url": "https://github.com/sponsors/kylekatarnls", @@ -2081,7 +2129,7 @@ "type": "tidelift" } ], - "time": "2022-08-06T12:41:24+00:00" + "time": "2022-09-02T07:48:13+00:00" }, { "name": "phar-io/manifest", @@ -2136,6 +2184,10 @@ } ], "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", + "support": { + "issues": "https://github.com/phar-io/manifest/issues", + "source": "https://github.com/phar-io/manifest/tree/master" + }, "time": "2017-03-05T18:14:27+00:00" }, { @@ -2183,6 +2235,10 @@ } ], "description": "Library for handling version information and constraints", + "support": { + "issues": "https://github.com/phar-io/version/issues", + "source": "https://github.com/phar-io/version/tree/master" + }, "time": "2017-03-05T17:38:23+00:00" }, { @@ -2226,6 +2282,10 @@ "static analysis", "wordpress" ], + "support": { + "issues": "https://github.com/php-stubs/wordpress-stubs/issues", + "source": "https://github.com/php-stubs/wordpress-stubs/tree/v6.0.1" + }, "time": "2022-07-15T11:10:45+00:00" }, { @@ -2287,6 +2347,10 @@ "selenium", "webdriver" ], + "support": { + "issues": "https://github.com/php-webdriver/php-webdriver/issues", + "source": "https://github.com/php-webdriver/php-webdriver/tree/1.12.1" + }, "time": "2022-05-03T12:16:34+00:00" }, { @@ -2336,6 +2400,10 @@ "reflection", "static analysis" ], + "support": { + "issues": "https://github.com/phpDocumentor/ReflectionCommon/issues", + "source": "https://github.com/phpDocumentor/ReflectionCommon/tree/2.x" + }, "time": "2020-06-27T09:03:43+00:00" }, { @@ -2389,6 +2457,10 @@ } ], "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", + "support": { + "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", + "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.3.0" + }, "time": "2021-10-19T17:43:47+00:00" }, { @@ -2435,6 +2507,10 @@ } ], "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" + }, "time": "2022-03-15T21:29:03+00:00" }, { @@ -2498,20 +2574,24 @@ "spy", "stub" ], + "support": { + "issues": "https://github.com/phpspec/prophecy/issues", + "source": "https://github.com/phpspec/prophecy/tree/v1.10.3" + }, "time": "2020-03-05T15:02:03+00:00" }, { "name": "phpstan/phpstan", - "version": "1.8.2", + "version": "1.8.5", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "c53312ecc575caf07b0e90dee43883fdf90ca67c" + "reference": "f6598a5ff12ca4499a836815e08b4d77a2ddeb20" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/c53312ecc575caf07b0e90dee43883fdf90ca67c", - "reference": "c53312ecc575caf07b0e90dee43883fdf90ca67c", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/f6598a5ff12ca4499a836815e08b4d77a2ddeb20", + "reference": "f6598a5ff12ca4499a836815e08b4d77a2ddeb20", "shasum": "" }, "require": { @@ -2535,6 +2615,14 @@ "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.5" + }, "funding": [ { "url": "https://github.com/ondrejmirtes", @@ -2544,16 +2632,12 @@ "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-09-07T16:05:32+00:00" }, { "name": "phpunit/php-code-coverage", @@ -2616,6 +2700,10 @@ "testing", "xunit" ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/5.3" + }, "time": "2018-04-06T15:36:58+00:00" }, { @@ -2663,6 +2751,11 @@ "filesystem", "iterator" ], + "support": { + "irc": "irc://irc.freenode.net/phpunit", + "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/1.4.5" + }, "time": "2017-11-27T13:52:08+00:00" }, { @@ -2704,6 +2797,10 @@ "keywords": [ "template" ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-text-template/issues", + "source": "https://github.com/sebastianbergmann/php-text-template/tree/1.2.1" + }, "time": "2015-06-21T13:50:34+00:00" }, { @@ -2753,6 +2850,10 @@ "keywords": [ "timer" ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-timer/issues", + "source": "https://github.com/sebastianbergmann/php-timer/tree/master" + }, "time": "2017-02-26T11:10:40+00:00" }, { @@ -2802,6 +2903,10 @@ "keywords": [ "tokenizer" ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-token-stream/issues", + "source": "https://github.com/sebastianbergmann/php-token-stream/tree/master" + }, "abandoned": true, "time": "2017-11-27T05:48:46+00:00" }, @@ -2887,6 +2992,10 @@ "testing", "xunit" ], + "support": { + "issues": "https://github.com/sebastianbergmann/phpunit/issues", + "source": "https://github.com/sebastianbergmann/phpunit/tree/6.5.14" + }, "time": "2019-02-01T05:22:47+00:00" }, { @@ -2946,9 +3055,61 @@ "mock", "xunit" ], + "support": { + "issues": "https://github.com/sebastianbergmann/phpunit-mock-objects/issues", + "source": "https://github.com/sebastianbergmann/phpunit-mock-objects/tree/5.0.10" + }, "abandoned": true, "time": "2018-08-09T05:50:03+00:00" }, + { + "name": "psr/container", + "version": "1.1.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "513e0666f7216c7459170d56df27dfcefe1689ea" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/513e0666f7216c7459170d56df27dfcefe1689ea", + "reference": "513e0666f7216c7459170d56df27dfcefe1689ea", + "shasum": "" + }, + "require": { + "php": ">=7.4.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "support": { + "issues": "https://github.com/php-fig/container/issues", + "source": "https://github.com/php-fig/container/tree/1.1.2" + }, + "time": "2021-11-05T16:50:12+00:00" + }, { "name": "psr/event-dispatcher", "version": "1.0.0", @@ -2993,6 +3154,10 @@ "psr", "psr-14" ], + "support": { + "issues": "https://github.com/php-fig/event-dispatcher/issues", + "source": "https://github.com/php-fig/event-dispatcher/tree/1.0.0" + }, "time": "2019-01-08T18:20:26+00:00" }, { @@ -3042,6 +3207,9 @@ "psr", "psr-18" ], + "support": { + "source": "https://github.com/php-fig/http-client/tree/master" + }, "time": "2020-06-29T06:28:15+00:00" }, { @@ -3094,6 +3262,9 @@ "request", "response" ], + "support": { + "source": "https://github.com/php-fig/http-factory/tree/master" + }, "time": "2019-04-30T12:38:16+00:00" }, { @@ -3144,6 +3315,9 @@ "request", "response" ], + "support": { + "source": "https://github.com/php-fig/http-message/tree/master" + }, "time": "2016-08-06T14:39:51+00:00" }, { @@ -3192,6 +3366,9 @@ "psr-16", "simple-cache" ], + "support": { + "source": "https://github.com/php-fig/simple-cache/tree/master" + }, "time": "2017-10-23T01:57:42+00:00" }, { @@ -3232,6 +3409,10 @@ } ], "description": "A polyfill for getallheaders.", + "support": { + "issues": "https://github.com/ralouphie/getallheaders/issues", + "source": "https://github.com/ralouphie/getallheaders/tree/develop" + }, "time": "2019-03-08T08:55:37+00:00" }, { @@ -3288,6 +3469,10 @@ "iri", "sockets" ], + "support": { + "issues": "https://github.com/WordPress/Requests/issues", + "source": "https://github.com/WordPress/Requests/tree/v1.8.1" + }, "time": "2021-06-04T09:56:25+00:00" }, { @@ -3333,6 +3518,10 @@ ], "description": "Looks up which function or method a line of code belongs to", "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", + "support": { + "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", + "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/1.0.2" + }, "funding": [ { "url": "https://github.com/sebastianbergmann", @@ -3403,6 +3592,10 @@ "compare", "equality" ], + "support": { + "issues": "https://github.com/sebastianbergmann/comparator/issues", + "source": "https://github.com/sebastianbergmann/comparator/tree/master" + }, "time": "2018-02-01T13:46:46+00:00" }, { @@ -3455,6 +3648,10 @@ "keywords": [ "diff" ], + "support": { + "issues": "https://github.com/sebastianbergmann/diff/issues", + "source": "https://github.com/sebastianbergmann/diff/tree/master" + }, "time": "2017-08-03T08:09:46+00:00" }, { @@ -3505,20 +3702,24 @@ "environment", "hhvm" ], + "support": { + "issues": "https://github.com/sebastianbergmann/environment/issues", + "source": "https://github.com/sebastianbergmann/environment/tree/master" + }, "time": "2017-07-01T08:51:00+00:00" }, { "name": "sebastian/exporter", - "version": "3.1.4", + "version": "3.1.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "0c32ea2e40dbf59de29f3b49bf375176ce7dd8db" + "reference": "73a9676f2833b9a7c36968f9d882589cd75511e6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/0c32ea2e40dbf59de29f3b49bf375176ce7dd8db", - "reference": "0c32ea2e40dbf59de29f3b49bf375176ce7dd8db", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/73a9676f2833b9a7c36968f9d882589cd75511e6", + "reference": "73a9676f2833b9a7c36968f9d882589cd75511e6", "shasum": "" }, "require": { @@ -3572,13 +3773,17 @@ "export", "exporter" ], + "support": { + "issues": "https://github.com/sebastianbergmann/exporter/issues", + "source": "https://github.com/sebastianbergmann/exporter/tree/3.1.5" + }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" } ], - "time": "2021-11-11T13:51:24+00:00" + "time": "2022-09-14T06:00:17+00:00" }, { "name": "sebastian/global-state", @@ -3629,6 +3834,10 @@ "keywords": [ "global state" ], + "support": { + "issues": "https://github.com/sebastianbergmann/global-state/issues", + "source": "https://github.com/sebastianbergmann/global-state/tree/2.0.0" + }, "time": "2017-04-27T15:39:26+00:00" }, { @@ -3676,6 +3885,10 @@ ], "description": "Traverses array structures and object graphs to enumerate all referenced objects", "homepage": "https://github.com/sebastianbergmann/object-enumerator/", + "support": { + "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", + "source": "https://github.com/sebastianbergmann/object-enumerator/tree/3.0.4" + }, "funding": [ { "url": "https://github.com/sebastianbergmann", @@ -3727,6 +3940,10 @@ ], "description": "Allows reflection of object attributes, including inherited and non-public ones", "homepage": "https://github.com/sebastianbergmann/object-reflector/", + "support": { + "issues": "https://github.com/sebastianbergmann/object-reflector/issues", + "source": "https://github.com/sebastianbergmann/object-reflector/tree/1.1.2" + }, "funding": [ { "url": "https://github.com/sebastianbergmann", @@ -3786,6 +4003,10 @@ ], "description": "Provides functionality to recursively process PHP variables", "homepage": "http://www.github.com/sebastianbergmann/recursion-context", + "support": { + "issues": "https://github.com/sebastianbergmann/recursion-context/issues", + "source": "https://github.com/sebastianbergmann/recursion-context/tree/3.0.1" + }, "funding": [ { "url": "https://github.com/sebastianbergmann", @@ -3834,6 +4055,10 @@ ], "description": "Provides a list of PHP built-in functions that operate on resources", "homepage": "https://www.github.com/sebastianbergmann/resource-operations", + "support": { + "issues": "https://github.com/sebastianbergmann/resource-operations/issues", + "source": "https://github.com/sebastianbergmann/resource-operations/tree/master" + }, "time": "2015-07-28T20:34:47+00:00" }, { @@ -3877,6 +4102,10 @@ ], "description": "Library that helps with managing the version number of Git-hosted PHP projects", "homepage": "https://github.com/sebastianbergmann/version", + "support": { + "issues": "https://github.com/sebastianbergmann/version/issues", + "source": "https://github.com/sebastianbergmann/version/tree/master" + }, "time": "2016-10-03T07:35:21+00:00" }, { @@ -3930,6 +4159,12 @@ } ], "description": "JSONPath implementation for parsing, searching and flattening arrays", + "support": { + "email": "hello@1-2.dev", + "forum": "https://github.com/SoftCreatR/JSONPath/discussions", + "issues": "https://github.com/SoftCreatR/JSONPath/issues", + "source": "https://github.com/SoftCreatR/JSONPath" + }, "funding": [ { "url": "https://github.com/softcreatr", @@ -3991,6 +4226,9 @@ ], "description": "Simulates the behavior of a web browser, allowing you to make requests, click on links and submit forms programmatically", "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/browser-kit/tree/v5.4.11" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -4009,16 +4247,16 @@ }, { "name": "symfony/console", - "version": "v5.4.11", + "version": "v5.4.12", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "535846c7ee6bc4dd027ca0d93220601456734b10" + "reference": "c072aa8f724c3af64e2c7a96b796a4863d24dba1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/535846c7ee6bc4dd027ca0d93220601456734b10", - "reference": "535846c7ee6bc4dd027ca0d93220601456734b10", + "url": "https://api.github.com/repos/symfony/console/zipball/c072aa8f724c3af64e2c7a96b796a4863d24dba1", + "reference": "c072aa8f724c3af64e2c7a96b796a4863d24dba1", "shasum": "" }, "require": { @@ -4087,6 +4325,9 @@ "console", "terminal" ], + "support": { + "source": "https://github.com/symfony/console/tree/v5.4.12" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -4101,7 +4342,7 @@ "type": "tidelift" } ], - "time": "2022-07-22T10:42:43+00:00" + "time": "2022-08-17T13:18:05+00:00" }, { "name": "symfony/css-selector", @@ -4150,6 +4391,9 @@ ], "description": "Converts CSS selectors to XPath expressions", "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/css-selector/tree/v5.4.11" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -4214,6 +4458,9 @@ ], "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.2" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -4232,16 +4479,16 @@ }, { "name": "symfony/dom-crawler", - "version": "v5.4.11", + "version": "v5.4.12", "source": { "type": "git", "url": "https://github.com/symfony/dom-crawler.git", - "reference": "0b900ca5576ecd59e08c76127e616667cfe427a7" + "reference": "291c1e92281a09152dda089f782e23dedd34bd4f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/0b900ca5576ecd59e08c76127e616667cfe427a7", - "reference": "0b900ca5576ecd59e08c76127e616667cfe427a7", + "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/291c1e92281a09152dda089f782e23dedd34bd4f", + "reference": "291c1e92281a09152dda089f782e23dedd34bd4f", "shasum": "" }, "require": { @@ -4286,6 +4533,9 @@ ], "description": "Eases DOM navigation for HTML and XML documents", "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/dom-crawler/tree/v5.4.12" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -4300,7 +4550,7 @@ "type": "tidelift" } ], - "time": "2022-06-27T16:58:25+00:00" + "time": "2022-08-03T13:09:21+00:00" }, { "name": "symfony/event-dispatcher", @@ -4368,6 +4618,9 @@ ], "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/v5.4.9" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -4444,6 +4697,9 @@ "interoperability", "standards" ], + "support": { + "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v2.5.2" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -4504,6 +4760,9 @@ ], "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/finder/tree/v5.4.11" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -4583,6 +4842,9 @@ "polyfill", "portable" ], + "support": { + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.26.0" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -4661,6 +4923,9 @@ "portable", "shim" ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.26.0" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -4742,6 +5007,9 @@ "portable", "shim" ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.26.0" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -4822,6 +5090,9 @@ "portable", "shim" ], + "support": { + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.26.0" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -4898,6 +5169,9 @@ "portable", "shim" ], + "support": { + "source": "https://github.com/symfony/polyfill-php73/tree/v1.26.0" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -4978,6 +5252,9 @@ "portable", "shim" ], + "support": { + "source": "https://github.com/symfony/polyfill-php80/tree/v1.26.0" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -5037,6 +5314,9 @@ ], "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/process/tree/v5.4.11" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -5117,6 +5397,9 @@ "interoperability", "standards" ], + "support": { + "source": "https://github.com/symfony/service-contracts/tree/v2.5.2" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -5135,16 +5418,16 @@ }, { "name": "symfony/string", - "version": "v5.4.11", + "version": "v5.4.12", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "5eb661e49ad389e4ae2b6e4df8d783a8a6548322" + "reference": "2fc515e512d721bf31ea76bd02fe23ada4640058" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/5eb661e49ad389e4ae2b6e4df8d783a8a6548322", - "reference": "5eb661e49ad389e4ae2b6e4df8d783a8a6548322", + "url": "https://api.github.com/repos/symfony/string/zipball/2fc515e512d721bf31ea76bd02fe23ada4640058", + "reference": "2fc515e512d721bf31ea76bd02fe23ada4640058", "shasum": "" }, "require": { @@ -5200,6 +5483,9 @@ "utf-8", "utf8" ], + "support": { + "source": "https://github.com/symfony/string/tree/v5.4.12" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -5214,20 +5500,20 @@ "type": "tidelift" } ], - "time": "2022-07-24T16:15:25+00:00" + "time": "2022-08-12T17:03:11+00:00" }, { "name": "symfony/translation", - "version": "v5.4.11", + "version": "v5.4.12", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "7a1a8f6bbff269f434a83343a0a5d36a4f8cfa21" + "reference": "42ecc77eb4f229ce2df702a648ec93b8478d76ae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/7a1a8f6bbff269f434a83343a0a5d36a4f8cfa21", - "reference": "7a1a8f6bbff269f434a83343a0a5d36a4f8cfa21", + "url": "https://api.github.com/repos/symfony/translation/zipball/42ecc77eb4f229ce2df702a648ec93b8478d76ae", + "reference": "42ecc77eb4f229ce2df702a648ec93b8478d76ae", "shasum": "" }, "require": { @@ -5294,6 +5580,9 @@ ], "description": "Provides tools to internationalize your application", "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/translation/tree/v5.4.12" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -5308,7 +5597,7 @@ "type": "tidelift" } ], - "time": "2022-07-20T13:00:38+00:00" + "time": "2022-08-02T15:52:22+00:00" }, { "name": "symfony/translation-contracts", @@ -5369,6 +5658,9 @@ "interoperability", "standards" ], + "support": { + "source": "https://github.com/symfony/translation-contracts/tree/v2.5.2" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -5387,16 +5679,16 @@ }, { "name": "symfony/yaml", - "version": "v5.4.11", + "version": "v5.4.12", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "05d4ea560f3402c6c116afd99fdc66e60eda227e" + "reference": "7a3aa21ac8ab1a96cc6de5bbcab4bc9fc943b18c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/05d4ea560f3402c6c116afd99fdc66e60eda227e", - "reference": "05d4ea560f3402c6c116afd99fdc66e60eda227e", + "url": "https://api.github.com/repos/symfony/yaml/zipball/7a3aa21ac8ab1a96cc6de5bbcab4bc9fc943b18c", + "reference": "7a3aa21ac8ab1a96cc6de5bbcab4bc9fc943b18c", "shasum": "" }, "require": { @@ -5441,6 +5733,9 @@ ], "description": "Loads and dumps YAML files", "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/yaml/tree/v5.4.12" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -5455,7 +5750,7 @@ "type": "tidelift" } ], - "time": "2022-06-27T16:58:25+00:00" + "time": "2022-08-02T15:52:22+00:00" }, { "name": "szepeviktor/phpstan-wordpress", @@ -5510,6 +5805,10 @@ "static analysis", "wordpress" ], + "support": { + "issues": "https://github.com/szepeviktor/phpstan-wordpress/issues", + "source": "https://github.com/szepeviktor/phpstan-wordpress/tree/v1.1.2" + }, "funding": [ { "url": "https://www.paypal.me/szepeviktor", @@ -5556,6 +5855,10 @@ } ], "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", + "support": { + "issues": "https://github.com/theseer/tokenizer/issues", + "source": "https://github.com/theseer/tokenizer/tree/1.2.1" + }, "funding": [ { "url": "https://github.com/theseer", @@ -5610,6 +5913,10 @@ "clean", "php" ], + "support": { + "issues": "https://github.com/voku/portable-ascii/issues", + "source": "https://github.com/voku/portable-ascii/tree/1.6.1" + }, "funding": [ { "url": "https://www.paypal.me/moelleken", @@ -5680,6 +5987,11 @@ "string", "text" ], + "support": { + "email": "contact@vria.eu", + "issues": "https://github.com/vria/nodiacritic/issues", + "source": "https://github.com/vria/nodiacritic/tree/0.1.2" + }, "time": "2016-09-17T22:03:11+00:00" }, { @@ -5734,6 +6046,10 @@ "check", "validate" ], + "support": { + "issues": "https://github.com/webmozarts/assert/issues", + "source": "https://github.com/webmozarts/assert/tree/1.11.0" + }, "time": "2022-06-03T18:03:27+00:00" }, { @@ -5782,20 +6098,23 @@ ], "description": "A simple YAML loader/dumper class for PHP (WP-CLI fork)", "homepage": "https://github.com/mustangostang/spyc/", + "support": { + "source": "https://github.com/wp-cli/spyc/tree/autoload" + }, "time": "2017-04-25T11:26:20+00:00" }, { "name": "wp-cli/php-cli-tools", - "version": "v0.11.14", + "version": "v0.11.15", "source": { "type": "git", "url": "https://github.com/wp-cli/php-cli-tools.git", - "reference": "f8f340e4a87687549d046e2da516242f7f36c934" + "reference": "b6edd35988892ea1451392eb7a26d9dbe98c836d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wp-cli/php-cli-tools/zipball/f8f340e4a87687549d046e2da516242f7f36c934", - "reference": "f8f340e4a87687549d046e2da516242f7f36c934", + "url": "https://api.github.com/repos/wp-cli/php-cli-tools/zipball/b6edd35988892ea1451392eb7a26d9dbe98c836d", + "reference": "b6edd35988892ea1451392eb7a26d9dbe98c836d", "shasum": "" }, "require": { @@ -5832,7 +6151,11 @@ "cli", "console" ], - "time": "2022-07-04T21:44:34+00:00" + "support": { + "issues": "https://github.com/wp-cli/php-cli-tools/issues", + "source": "https://github.com/wp-cli/php-cli-tools/tree/v0.11.15" + }, + "time": "2022-08-15T10:15:55+00:00" }, { "name": "wp-cli/wp-cli", @@ -5898,6 +6221,11 @@ "cli", "wordpress" ], + "support": { + "docs": "https://make.wordpress.org/cli/handbook/", + "issues": "https://github.com/wp-cli/wp-cli/issues", + "source": "https://github.com/wp-cli/wp-cli" + }, "time": "2022-01-25T16:31:27+00:00" }, { @@ -5950,6 +6278,10 @@ "php", "template" ], + "support": { + "issues": "https://github.com/zordius/lightncandy/issues", + "source": "https://github.com/zordius/lightncandy/tree/v1.2.6" + }, "time": "2021-07-11T04:52:41+00:00" } ], @@ -5960,5 +6292,5 @@ "prefer-lowest": false, "platform": [], "platform-dev": [], - "plugin-api-version": "1.1.0" + "plugin-api-version": "2.3.0" } diff --git a/src/DB/Config.php b/src/DB/Config.php new file mode 100644 index 0000000..1924911 --- /dev/null +++ b/src/DB/Config.php @@ -0,0 +1,69 @@ +getVar( 'stellarwp_db_initialized', false ) ) { + if ( ! self::$initialized ) { return; } - $container->register( Database\Provider::class ); - $container->setVar( 'stellarwp_db_initialized', true ); + self::$provider = new Database\Provider(); + self::$provider->register(); + self::$initialized = true; } /** @@ -101,14 +114,29 @@ static function () use ( $name, $arguments ) { global $wpdb; if ( in_array( $name, [ 'get_row', 'get_col', 'get_results', 'query' ], true) ) { + $hook_prefix = Config::getHookPrefix(); + /** * Allow for hooking just before query execution. * * @since 1.0.0 * - * @param string $argument + * @param string $argument First argument passed to the $wpdb method. + * @param string $hook_prefix Prefix for the hook. */ - do_action( 'stellarwp_db_pre_query', current( $arguments ) ); + do_action( 'stellarwp_db_pre_query', current( $arguments ), $hook_prefix ); + + if ( $hook_prefix ) { + /** + * Allow for hooking just before query execution. + * + * @since 1.0.0 + * + * @param string $argument First argument passed to the $wpdb method. + * @param string $hook_prefix Prefix for the hook. + */ + do_action( "{$hook_prefix}_stellarwp_db_pre_query", current( $arguments ), $hook_prefix ); + } } return call_user_func_array( [ $wpdb, $name ], $arguments ); @@ -172,7 +200,7 @@ public static function transaction( callable $callback ) { try { $callback(); - } catch (Exception $e) { + } catch ( Exception $e ) { self::rollback(); throw $e; } @@ -255,7 +283,10 @@ private static function runQueryWithErrorChecking( $queryCaller ) { $wpError = self::getQueryErrors( $errorCount ); if ( ! empty( $wpError->errors ) ) { - throw new DatabaseQueryException( $wpdb->last_query, $wpError->errors ); + /** @var DatabaseQueryException */ + $exception_class = Config::getDatabaseQueryException(); + + throw new $exception_class( $wpdb->last_query, $wpError->errors ); } return $output; diff --git a/src/DB/Database/Provider.php b/src/DB/Database/Provider.php index 09e1b8a..974f54a 100644 --- a/src/DB/Database/Provider.php +++ b/src/DB/Database/Provider.php @@ -2,10 +2,11 @@ namespace StellarWP\DB\Database; -use lucatume\DI52\App; -use lucatume\DI52\ServiceProvider; - -class Provider extends ServiceProvider { +class Provider { + /** + * @var Actions\EnableBigSqlSelects + */ + public $action_enable_big_sql_selects; /** * Binds and sets up implementations. @@ -13,17 +14,17 @@ class Provider extends ServiceProvider { * @since 1.0.0 */ public function register() { - $this->container->singleton( static::class, $this ); - $this->container->singleton( Actions\EnableBigSqlSelects::class, Actions\EnableBigSqlSelects::class ); - $this->register_hooks(); + add_action( 'stellarwp_db_pre_query', [ $this, 'enable_big_sql_selects' ] ); } /** - * Registers all hooks. - * - * @since 1.0.0 + * Fires the EnableBigSqlSelects action. */ - private function register_hooks() : void { - add_action( 'stellarwp_db_pre_query', App::callback( Actions\EnableBigSqlSelects::class, 'set_var' ) ); + public function enable_big_sql_selects() { + if ( $this->action_enable_big_sql_selects === null ) { + $this->action_enable_big_sql_selects = new Actions\EnableBigSqlSelects(); + } + + $this->action_enable_big_sql_selects->set_var(); } } diff --git a/tests/_support/Helper/DBTestCase.php b/tests/_support/Helper/DBTestCase.php index 6613b7b..acfcc3a 100644 --- a/tests/_support/Helper/DBTestCase.php +++ b/tests/_support/Helper/DBTestCase.php @@ -2,7 +2,6 @@ namespace StellarWP\DB\Tests; -use lucatume\DI52\App; use StellarWP\DB\DB; class DBTestCase extends \Codeception\Test\Unit { diff --git a/tests/_support/Helper/InvalidDatabaseQueryException.php b/tests/_support/Helper/InvalidDatabaseQueryException.php new file mode 100644 index 0000000..2a09dbf --- /dev/null +++ b/tests/_support/Helper/InvalidDatabaseQueryException.php @@ -0,0 +1,5 @@ +assertEquals( 'bork', Config::getHookPrefix() ); + } + + /** + * @test + */ + public function should_set_exception_when_exception_is_valid() { + Config::setDatabaseQueryException( ValidDatabaseQueryException::class ); + + $this->assertEquals( ValidDatabaseQueryException::class, Config::getDatabaseQueryException() ); + } + + /** + * @test + */ + public function should_not_set_exception_when_exception_is_invalid() { + + try { + Config::setDatabaseQueryException( InvalidDatabaseQueryException::class ); + } catch ( \Exception $e ) { + $this->assertEquals( \InvalidArgumentException::class, get_class( $e ) ); + } + + $this->assertEquals( DatabaseQueryException::class, Config::getDatabaseQueryException() ); + } +} diff --git a/tests/wpunit/DBTest.php b/tests/wpunit/DBTest.php new file mode 100644 index 0000000..4cfe66a --- /dev/null +++ b/tests/wpunit/DBTest.php @@ -0,0 +1,101 @@ + 'get_row', + 'prefix' => '', + ], + [ + 'method' => 'get_col', + 'prefix' => '', + ], + [ + 'method' => 'get_results', + 'prefix' => '', + ], + [ + 'method' => 'query', + 'prefix' => '', + ], + [ + 'method' => 'get_row', + 'prefix' => 'bork', + ], + [ + 'method' => 'get_col', + 'prefix' => 'bork', + ], + [ + 'method' => 'get_results', + 'prefix' => 'bork', + ], + [ + 'method' => 'query', + 'prefix' => 'bork', + ], + ]; + } + + /** + * @dataProvider callWithPrefix + * @test + */ + public function should_hook_action_on_method_call( $method, $prefix ) { + Config::setHookPrefix( $prefix ); + $called_prefix = null; + $called = false; + $action = static function( $args, $hook_prefix ) use ( &$called, &$called_prefix ) { + $called = true; + $called_prefix = $hook_prefix; + }; + + add_action( 'stellarwp_db_pre_query', $action, 10, 2 ); + + DB::$method( "SELECT 1" ); + + $this->assertTrue( $called ); + $this->assertEquals( $prefix, $called_prefix ); + + remove_action( 'stellarwp_db_pre_query', $action, 10, 2 ); + } + + /** + * @test + */ + public function should_throw_exception_on_query_error() { + $this->expectException( DatabaseQueryException::class ); + + DB::query( "SELECT * FROM bork" ); + } + + /** + * @test + */ + public function should_throw_custom_exception_on_query_error() { + Config::setDatabaseQueryException( ValidDatabaseQueryException::class ); + $this->expectException( ValidDatabaseQueryException::class ); + + DB::query( "SELECT * FROM bork" ); + } +}