├── .github └── workflows │ └── tests.yml ├── .gitignore ├── CHANGELOG.md ├── LICENSE ├── README.md ├── codecov.yml ├── composer.json ├── composer.lock ├── phpunit.xml ├── src ├── Builder.php ├── Concerns │ ├── BootsTraits.php │ ├── HasScopes.php │ └── QueriesPosts.php ├── Query.php ├── Scope.php └── Scopes │ ├── Author.php │ ├── AuthorIn.php │ ├── AuthorNotIn.php │ ├── Comments.php │ ├── Meta.php │ ├── Order.php │ ├── OrderBy.php │ ├── Page.php │ ├── ParentIn.php │ ├── ParentNotIn.php │ ├── Password.php │ ├── Post.php │ ├── PostIn.php │ ├── PostNotIn.php │ ├── PostParent.php │ ├── PostStatus.php │ ├── PostType.php │ ├── PostsPerPage.php │ ├── Search.php │ └── Taxonomy.php └── tests └── Unit └── Query ├── BuilderTest.php ├── Concerns └── HasScopesTest.php ├── QueryTest.php ├── Scopes ├── AuthorInTest.php ├── AuthorNotInTest.php ├── AuthorTest.php ├── CommentsTest.php ├── MetaTest.php ├── OrderByTest.php ├── OrderTest.php ├── PageTest.php ├── ParentInTest.php ├── ParentNotInTest.php ├── PasswordTest.php ├── PostInTest.php ├── PostNotInTest.php ├── PostParentTest.php ├── PostStatusTest.php ├── PostTest.php ├── PostTypeTest.php ├── PostsPerPageTest.php ├── SearchTest.php └── TaxonomyTest.php └── Stubs └── TestScope.php /.github/workflows/tests.yml: -------------------------------------------------------------------------------- 1 | name: tests 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | pull_request: 8 | branches: 9 | - master 10 | 11 | jobs: 12 | build: 13 | runs-on: ubuntu-latest 14 | steps: 15 | - uses: actions/checkout@v2 16 | 17 | - name: Setup PHP 18 | uses: shivammathur/setup-php@v2 19 | with: 20 | php-version: 7.4 21 | 22 | - name: Validate composer.json and composer.lock 23 | run: composer validate --strict 24 | 25 | - name: Cache Composer packages 26 | id: composer-cache 27 | uses: actions/cache@v2 28 | with: 29 | path: vendor 30 | key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} 31 | restore-keys: | 32 | ${{ runner.os }}-php- 33 | 34 | - name: Install dependencies 35 | run: composer install --prefer-dist --no-progress 36 | 37 | - name: Run test suite 38 | run: composer run-script test 39 | 40 | - name: Upload coverage to Codecov 41 | uses: codecov/codecov-action@v1 42 | with: 43 | file: ./coverage.xml 44 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | vendor 2 | .phpunit.result.cache 3 | coverage.xml 4 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | ### v0.2.0 4 | 5 | * Add `Query::addScope` method for custom scopes 6 | * Create `BootableTraits` trait 7 | * Create `QueriesPosts` trait 8 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | 2 | The MIT License (MIT) 3 | 4 | Copyright (c) 2020 jjgrainger 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # WordPress Query Builder v0.2.0 2 | 3 | > A fluent interface for creating WordPress Queries 4 | 5 | [![tests](https://github.com/jjgrainger/Query/actions/workflows/tests.yml/badge.svg)](https://github.com/jjgrainger/Query/actions/workflows/tests.yml) [![codecov](https://codecov.io/gh/jjgrainger/Query/branch/master/graph/badge.svg)](https://codecov.io/gh/jjgrainger/Query) [![Total Downloads](https://poser.pugx.org/jjgrainger/query/downloads)](https://packagist.org/packages/jjgrainger/query) [![Latest Stable Version](https://poser.pugx.org/jjgrainger/query/v/stable)](https://packagist.org/packages/jjgrainger/query) [![License](https://poser.pugx.org/jjgrainger/query/license)](https://packagist.org/packages/jjgrainger/query) 6 | 7 | ## Requirements 8 | 9 | * PHP >= 7.2 10 | * [Composer](https://getcomposer.org/) 11 | * [WordPress](https://wordpress.org) 5.3.2 12 | 13 | ## Installation 14 | 15 | ``` 16 | $ composer require jjgrainger/query 17 | ``` 18 | 19 | ## Usage 20 | 21 | The `Query` class provides a fluent interface for create `WP_Query` in WordPress. 22 | 23 | ```php 24 | use Query\Query; 25 | 26 | // Create a new WP_Query for the latest 3 products. 27 | $results = Query::post_type( 'product' )->posts_per_page( 3 )->get(); 28 | 29 | // The above is the same as... 30 | $args = [ 31 | 'post_type' => 'product', 32 | 'posts_per_page' => 3, 33 | ]; 34 | 35 | $results = new \WP_Query( $args ); 36 | ``` 37 | 38 | ### Creating Custom Query Classes 39 | 40 | Custom query classes can be created by extending the `Query` class. Custom query classes can encapsulate default parameters which can then be expanded upon with query methods. 41 | 42 | For example, a `FeaturedPostsQuery` can be created to return posts with the 'featured' taxonomy term. The default query parameters are defined within the `setup()` method that receives a `Builder` instance. 43 | 44 | ```php 45 | use Query\Query; 46 | use Query\Builder; 47 | 48 | class FeaturedPostsQuery extends Query 49 | { 50 | /** 51 | * Setup the initial query. 52 | * 53 | * @param Builder $builder 54 | * 55 | * @return Builder 56 | */ 57 | public function setup( Builder $builder ): Builder 58 | { 59 | // Setup a tax_query for posts with the 'featured' term. 60 | $tax_query = [ 61 | [ 62 | 'taxonomy' => 'featured', 63 | 'fields' => 'slugs', 64 | 'terms' => [ 'featured' ], 65 | ], 66 | ]; 67 | 68 | return $builder->where( 'tax_query', $tax_query ); 69 | } 70 | } 71 | ``` 72 | Once the query class is created it can be used through out the project in a vairety of ways. 73 | 74 | ```php 75 | use FeaturedPostsQuery as Featured; 76 | 77 | // Returns a WP_Query object for posts with the featured term. 78 | $results = Featured::get(); 79 | 80 | // Returns a WP_Query object for the latest 3 products with the featured term. 81 | $results = Featured::type( 'products' )->limit( 3 )->get(); 82 | 83 | // Queries can be instantiated with an array of additional query arguments. 84 | $args = [ 85 | 'post_type' => 'products', 86 | ]; 87 | 88 | // Create a query object. 89 | $query = new Featured( $args ); 90 | 91 | // Modify the query and get the WP_Query object. 92 | $results = $query->limit( 3 )->get(); 93 | ``` 94 | 95 | ### Custom Scopes 96 | 97 | Custom scopes can be added to the global `Query` using the static `addScope` method. One of the simplest ways to add a scope is with a closure. 98 | 99 | ```php 100 | // Create a new scope with a closure. 101 | Query::addScope( 'events', function( Builder $builder ) { 102 | return $builder->where( 'post_type', 'event' ); 103 | } ); 104 | 105 | // Call the scope when needed. 106 | $results = Query::events()->limit( 3 ); 107 | ``` 108 | 109 | #### Custom Scope Classes 110 | 111 | Custom scope classes can be added to the global `Query`. The custom scope class will need to implement the `Scope` interface and contain the required `apply` method. 112 | The `apply` method should accept the query `Builder` as the first argument and any optional arguments passed via the scope. 113 | Once added to the `Query` class the scope will be available by the class name with the first letter lowecase. 114 | 115 | ```php 116 | // Create a custom scope class. 117 | use Query\Scope; 118 | use Query\Builder; 119 | 120 | class PostID implements Scope { 121 | public function apply( Builder $builder, $id = null ) { 122 | return $builder->where( 'p', $id ); 123 | } 124 | } 125 | 126 | // Add the scope to the Query. 127 | Query::addScope( new PostID ); 128 | 129 | // Use the scope in the Query. 130 | $results = Query::postID( 123 )->get(); 131 | ``` 132 | 133 | ## Notes 134 | 135 | * The library is still in active development and not intended for production use. 136 | * Licensed under the [MIT License](https://github.com/jjgrainger/Query/blob/master/LICENSE) 137 | * Maintained under the [Semantic Versioning Guide](https://semver.org) 138 | 139 | ## Author 140 | 141 | **Joe Grainger** 142 | 143 | * [https://jjgrainger.co.uk](https://jjgrainger.co.uk) 144 | * [https://twitter.com/jjgrainger](https://twitter.com/jjgrainger) 145 | -------------------------------------------------------------------------------- /codecov.yml: -------------------------------------------------------------------------------- 1 | comment: false 2 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jjgrainger/query", 3 | "description": "WordPress Query Builder", 4 | "keywords": ["wordpress", "wp-query"], 5 | "type": "library", 6 | "license": "MIT", 7 | "authors": [ 8 | { 9 | "name": "jjgrainger", 10 | "email": "github@jjgrainger.co.uk" 11 | } 12 | ], 13 | "autoload": { 14 | "psr-4": { 15 | "Query\\": "src/" 16 | } 17 | }, 18 | "autoload-dev": { 19 | "psr-4": { 20 | "Query\\Tests\\": "tests/" 21 | } 22 | }, 23 | "require": { 24 | "php": ">=7.2" 25 | }, 26 | "require-dev": { 27 | "phpunit/phpunit": "8.*", 28 | "squizlabs/php_codesniffer": "3.*" 29 | }, 30 | "scripts": { 31 | "test": [ 32 | "./vendor/bin/phpcs --standard=psr2 src", 33 | "./vendor/bin/phpunit --coverage-clover=coverage.xml" 34 | ] 35 | }, 36 | "minimum-stability": "dev", 37 | "prefer-stable": true 38 | } 39 | -------------------------------------------------------------------------------- /composer.lock: -------------------------------------------------------------------------------- 1 | { 2 | "_readme": [ 3 | "This file locks the dependencies of your project to a known state", 4 | "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", 5 | "This file is @generated automatically" 6 | ], 7 | "content-hash": "ccc22e7dff3fd2c2cf074a6de0c094ae", 8 | "packages": [], 9 | "packages-dev": [ 10 | { 11 | "name": "doctrine/instantiator", 12 | "version": "1.4.1", 13 | "source": { 14 | "type": "git", 15 | "url": "https://github.com/doctrine/instantiator.git", 16 | "reference": "10dcfce151b967d20fde1b34ae6640712c3891bc" 17 | }, 18 | "dist": { 19 | "type": "zip", 20 | "url": "https://api.github.com/repos/doctrine/instantiator/zipball/10dcfce151b967d20fde1b34ae6640712c3891bc", 21 | "reference": "10dcfce151b967d20fde1b34ae6640712c3891bc", 22 | "shasum": "" 23 | }, 24 | "require": { 25 | "php": "^7.1 || ^8.0" 26 | }, 27 | "require-dev": { 28 | "doctrine/coding-standard": "^9", 29 | "ext-pdo": "*", 30 | "ext-phar": "*", 31 | "phpbench/phpbench": "^0.16 || ^1", 32 | "phpstan/phpstan": "^1.4", 33 | "phpstan/phpstan-phpunit": "^1", 34 | "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", 35 | "vimeo/psalm": "^4.22" 36 | }, 37 | "type": "library", 38 | "autoload": { 39 | "psr-4": { 40 | "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" 41 | } 42 | }, 43 | "notification-url": "https://packagist.org/downloads/", 44 | "license": [ 45 | "MIT" 46 | ], 47 | "authors": [ 48 | { 49 | "name": "Marco Pivetta", 50 | "email": "ocramius@gmail.com", 51 | "homepage": "https://ocramius.github.io/" 52 | } 53 | ], 54 | "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", 55 | "homepage": "https://www.doctrine-project.org/projects/instantiator.html", 56 | "keywords": [ 57 | "constructor", 58 | "instantiate" 59 | ], 60 | "support": { 61 | "issues": "https://github.com/doctrine/instantiator/issues", 62 | "source": "https://github.com/doctrine/instantiator/tree/1.4.1" 63 | }, 64 | "funding": [ 65 | { 66 | "url": "https://www.doctrine-project.org/sponsorship.html", 67 | "type": "custom" 68 | }, 69 | { 70 | "url": "https://www.patreon.com/phpdoctrine", 71 | "type": "patreon" 72 | }, 73 | { 74 | "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator", 75 | "type": "tidelift" 76 | } 77 | ], 78 | "time": "2022-03-03T08:28:38+00:00" 79 | }, 80 | { 81 | "name": "myclabs/deep-copy", 82 | "version": "1.11.0", 83 | "source": { 84 | "type": "git", 85 | "url": "https://github.com/myclabs/DeepCopy.git", 86 | "reference": "14daed4296fae74d9e3201d2c4925d1acb7aa614" 87 | }, 88 | "dist": { 89 | "type": "zip", 90 | "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/14daed4296fae74d9e3201d2c4925d1acb7aa614", 91 | "reference": "14daed4296fae74d9e3201d2c4925d1acb7aa614", 92 | "shasum": "" 93 | }, 94 | "require": { 95 | "php": "^7.1 || ^8.0" 96 | }, 97 | "conflict": { 98 | "doctrine/collections": "<1.6.8", 99 | "doctrine/common": "<2.13.3 || >=3,<3.2.2" 100 | }, 101 | "require-dev": { 102 | "doctrine/collections": "^1.6.8", 103 | "doctrine/common": "^2.13.3 || ^3.2.2", 104 | "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" 105 | }, 106 | "type": "library", 107 | "autoload": { 108 | "files": [ 109 | "src/DeepCopy/deep_copy.php" 110 | ], 111 | "psr-4": { 112 | "DeepCopy\\": "src/DeepCopy/" 113 | } 114 | }, 115 | "notification-url": "https://packagist.org/downloads/", 116 | "license": [ 117 | "MIT" 118 | ], 119 | "description": "Create deep copies (clones) of your objects", 120 | "keywords": [ 121 | "clone", 122 | "copy", 123 | "duplicate", 124 | "object", 125 | "object graph" 126 | ], 127 | "support": { 128 | "issues": "https://github.com/myclabs/DeepCopy/issues", 129 | "source": "https://github.com/myclabs/DeepCopy/tree/1.11.0" 130 | }, 131 | "funding": [ 132 | { 133 | "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", 134 | "type": "tidelift" 135 | } 136 | ], 137 | "time": "2022-03-03T13:19:32+00:00" 138 | }, 139 | { 140 | "name": "phar-io/manifest", 141 | "version": "2.0.3", 142 | "source": { 143 | "type": "git", 144 | "url": "https://github.com/phar-io/manifest.git", 145 | "reference": "97803eca37d319dfa7826cc2437fc020857acb53" 146 | }, 147 | "dist": { 148 | "type": "zip", 149 | "url": "https://api.github.com/repos/phar-io/manifest/zipball/97803eca37d319dfa7826cc2437fc020857acb53", 150 | "reference": "97803eca37d319dfa7826cc2437fc020857acb53", 151 | "shasum": "" 152 | }, 153 | "require": { 154 | "ext-dom": "*", 155 | "ext-phar": "*", 156 | "ext-xmlwriter": "*", 157 | "phar-io/version": "^3.0.1", 158 | "php": "^7.2 || ^8.0" 159 | }, 160 | "type": "library", 161 | "extra": { 162 | "branch-alias": { 163 | "dev-master": "2.0.x-dev" 164 | } 165 | }, 166 | "autoload": { 167 | "classmap": [ 168 | "src/" 169 | ] 170 | }, 171 | "notification-url": "https://packagist.org/downloads/", 172 | "license": [ 173 | "BSD-3-Clause" 174 | ], 175 | "authors": [ 176 | { 177 | "name": "Arne Blankerts", 178 | "email": "arne@blankerts.de", 179 | "role": "Developer" 180 | }, 181 | { 182 | "name": "Sebastian Heuer", 183 | "email": "sebastian@phpeople.de", 184 | "role": "Developer" 185 | }, 186 | { 187 | "name": "Sebastian Bergmann", 188 | "email": "sebastian@phpunit.de", 189 | "role": "Developer" 190 | } 191 | ], 192 | "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", 193 | "support": { 194 | "issues": "https://github.com/phar-io/manifest/issues", 195 | "source": "https://github.com/phar-io/manifest/tree/2.0.3" 196 | }, 197 | "time": "2021-07-20T11:28:43+00:00" 198 | }, 199 | { 200 | "name": "phar-io/version", 201 | "version": "3.2.1", 202 | "source": { 203 | "type": "git", 204 | "url": "https://github.com/phar-io/version.git", 205 | "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74" 206 | }, 207 | "dist": { 208 | "type": "zip", 209 | "url": "https://api.github.com/repos/phar-io/version/zipball/4f7fd7836c6f332bb2933569e566a0d6c4cbed74", 210 | "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74", 211 | "shasum": "" 212 | }, 213 | "require": { 214 | "php": "^7.2 || ^8.0" 215 | }, 216 | "type": "library", 217 | "autoload": { 218 | "classmap": [ 219 | "src/" 220 | ] 221 | }, 222 | "notification-url": "https://packagist.org/downloads/", 223 | "license": [ 224 | "BSD-3-Clause" 225 | ], 226 | "authors": [ 227 | { 228 | "name": "Arne Blankerts", 229 | "email": "arne@blankerts.de", 230 | "role": "Developer" 231 | }, 232 | { 233 | "name": "Sebastian Heuer", 234 | "email": "sebastian@phpeople.de", 235 | "role": "Developer" 236 | }, 237 | { 238 | "name": "Sebastian Bergmann", 239 | "email": "sebastian@phpunit.de", 240 | "role": "Developer" 241 | } 242 | ], 243 | "description": "Library for handling version information and constraints", 244 | "support": { 245 | "issues": "https://github.com/phar-io/version/issues", 246 | "source": "https://github.com/phar-io/version/tree/3.2.1" 247 | }, 248 | "time": "2022-02-21T01:04:05+00:00" 249 | }, 250 | { 251 | "name": "phpdocumentor/reflection-common", 252 | "version": "2.2.0", 253 | "source": { 254 | "type": "git", 255 | "url": "https://github.com/phpDocumentor/ReflectionCommon.git", 256 | "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b" 257 | }, 258 | "dist": { 259 | "type": "zip", 260 | "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/1d01c49d4ed62f25aa84a747ad35d5a16924662b", 261 | "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b", 262 | "shasum": "" 263 | }, 264 | "require": { 265 | "php": "^7.2 || ^8.0" 266 | }, 267 | "type": "library", 268 | "extra": { 269 | "branch-alias": { 270 | "dev-2.x": "2.x-dev" 271 | } 272 | }, 273 | "autoload": { 274 | "psr-4": { 275 | "phpDocumentor\\Reflection\\": "src/" 276 | } 277 | }, 278 | "notification-url": "https://packagist.org/downloads/", 279 | "license": [ 280 | "MIT" 281 | ], 282 | "authors": [ 283 | { 284 | "name": "Jaap van Otterdijk", 285 | "email": "opensource@ijaap.nl" 286 | } 287 | ], 288 | "description": "Common reflection classes used by phpdocumentor to reflect the code structure", 289 | "homepage": "http://www.phpdoc.org", 290 | "keywords": [ 291 | "FQSEN", 292 | "phpDocumentor", 293 | "phpdoc", 294 | "reflection", 295 | "static analysis" 296 | ], 297 | "support": { 298 | "issues": "https://github.com/phpDocumentor/ReflectionCommon/issues", 299 | "source": "https://github.com/phpDocumentor/ReflectionCommon/tree/2.x" 300 | }, 301 | "time": "2020-06-27T09:03:43+00:00" 302 | }, 303 | { 304 | "name": "phpdocumentor/reflection-docblock", 305 | "version": "5.3.0", 306 | "source": { 307 | "type": "git", 308 | "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", 309 | "reference": "622548b623e81ca6d78b721c5e029f4ce664f170" 310 | }, 311 | "dist": { 312 | "type": "zip", 313 | "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/622548b623e81ca6d78b721c5e029f4ce664f170", 314 | "reference": "622548b623e81ca6d78b721c5e029f4ce664f170", 315 | "shasum": "" 316 | }, 317 | "require": { 318 | "ext-filter": "*", 319 | "php": "^7.2 || ^8.0", 320 | "phpdocumentor/reflection-common": "^2.2", 321 | "phpdocumentor/type-resolver": "^1.3", 322 | "webmozart/assert": "^1.9.1" 323 | }, 324 | "require-dev": { 325 | "mockery/mockery": "~1.3.2", 326 | "psalm/phar": "^4.8" 327 | }, 328 | "type": "library", 329 | "extra": { 330 | "branch-alias": { 331 | "dev-master": "5.x-dev" 332 | } 333 | }, 334 | "autoload": { 335 | "psr-4": { 336 | "phpDocumentor\\Reflection\\": "src" 337 | } 338 | }, 339 | "notification-url": "https://packagist.org/downloads/", 340 | "license": [ 341 | "MIT" 342 | ], 343 | "authors": [ 344 | { 345 | "name": "Mike van Riel", 346 | "email": "me@mikevanriel.com" 347 | }, 348 | { 349 | "name": "Jaap van Otterdijk", 350 | "email": "account@ijaap.nl" 351 | } 352 | ], 353 | "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", 354 | "support": { 355 | "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", 356 | "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.3.0" 357 | }, 358 | "time": "2021-10-19T17:43:47+00:00" 359 | }, 360 | { 361 | "name": "phpdocumentor/type-resolver", 362 | "version": "1.6.1", 363 | "source": { 364 | "type": "git", 365 | "url": "https://github.com/phpDocumentor/TypeResolver.git", 366 | "reference": "77a32518733312af16a44300404e945338981de3" 367 | }, 368 | "dist": { 369 | "type": "zip", 370 | "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/77a32518733312af16a44300404e945338981de3", 371 | "reference": "77a32518733312af16a44300404e945338981de3", 372 | "shasum": "" 373 | }, 374 | "require": { 375 | "php": "^7.2 || ^8.0", 376 | "phpdocumentor/reflection-common": "^2.0" 377 | }, 378 | "require-dev": { 379 | "ext-tokenizer": "*", 380 | "psalm/phar": "^4.8" 381 | }, 382 | "type": "library", 383 | "extra": { 384 | "branch-alias": { 385 | "dev-1.x": "1.x-dev" 386 | } 387 | }, 388 | "autoload": { 389 | "psr-4": { 390 | "phpDocumentor\\Reflection\\": "src" 391 | } 392 | }, 393 | "notification-url": "https://packagist.org/downloads/", 394 | "license": [ 395 | "MIT" 396 | ], 397 | "authors": [ 398 | { 399 | "name": "Mike van Riel", 400 | "email": "me@mikevanriel.com" 401 | } 402 | ], 403 | "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", 404 | "support": { 405 | "issues": "https://github.com/phpDocumentor/TypeResolver/issues", 406 | "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.6.1" 407 | }, 408 | "time": "2022-03-15T21:29:03+00:00" 409 | }, 410 | { 411 | "name": "phpspec/prophecy", 412 | "version": "v1.15.0", 413 | "source": { 414 | "type": "git", 415 | "url": "https://github.com/phpspec/prophecy.git", 416 | "reference": "bbcd7380b0ebf3961ee21409db7b38bc31d69a13" 417 | }, 418 | "dist": { 419 | "type": "zip", 420 | "url": "https://api.github.com/repos/phpspec/prophecy/zipball/bbcd7380b0ebf3961ee21409db7b38bc31d69a13", 421 | "reference": "bbcd7380b0ebf3961ee21409db7b38bc31d69a13", 422 | "shasum": "" 423 | }, 424 | "require": { 425 | "doctrine/instantiator": "^1.2", 426 | "php": "^7.2 || ~8.0, <8.2", 427 | "phpdocumentor/reflection-docblock": "^5.2", 428 | "sebastian/comparator": "^3.0 || ^4.0", 429 | "sebastian/recursion-context": "^3.0 || ^4.0" 430 | }, 431 | "require-dev": { 432 | "phpspec/phpspec": "^6.0 || ^7.0", 433 | "phpunit/phpunit": "^8.0 || ^9.0" 434 | }, 435 | "type": "library", 436 | "extra": { 437 | "branch-alias": { 438 | "dev-master": "1.x-dev" 439 | } 440 | }, 441 | "autoload": { 442 | "psr-4": { 443 | "Prophecy\\": "src/Prophecy" 444 | } 445 | }, 446 | "notification-url": "https://packagist.org/downloads/", 447 | "license": [ 448 | "MIT" 449 | ], 450 | "authors": [ 451 | { 452 | "name": "Konstantin Kudryashov", 453 | "email": "ever.zet@gmail.com", 454 | "homepage": "http://everzet.com" 455 | }, 456 | { 457 | "name": "Marcello Duarte", 458 | "email": "marcello.duarte@gmail.com" 459 | } 460 | ], 461 | "description": "Highly opinionated mocking framework for PHP 5.3+", 462 | "homepage": "https://github.com/phpspec/prophecy", 463 | "keywords": [ 464 | "Double", 465 | "Dummy", 466 | "fake", 467 | "mock", 468 | "spy", 469 | "stub" 470 | ], 471 | "support": { 472 | "issues": "https://github.com/phpspec/prophecy/issues", 473 | "source": "https://github.com/phpspec/prophecy/tree/v1.15.0" 474 | }, 475 | "time": "2021-12-08T12:19:24+00:00" 476 | }, 477 | { 478 | "name": "phpunit/php-code-coverage", 479 | "version": "7.0.15", 480 | "source": { 481 | "type": "git", 482 | "url": "https://github.com/sebastianbergmann/php-code-coverage.git", 483 | "reference": "819f92bba8b001d4363065928088de22f25a3a48" 484 | }, 485 | "dist": { 486 | "type": "zip", 487 | "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/819f92bba8b001d4363065928088de22f25a3a48", 488 | "reference": "819f92bba8b001d4363065928088de22f25a3a48", 489 | "shasum": "" 490 | }, 491 | "require": { 492 | "ext-dom": "*", 493 | "ext-xmlwriter": "*", 494 | "php": ">=7.2", 495 | "phpunit/php-file-iterator": "^2.0.2", 496 | "phpunit/php-text-template": "^1.2.1", 497 | "phpunit/php-token-stream": "^3.1.3 || ^4.0", 498 | "sebastian/code-unit-reverse-lookup": "^1.0.1", 499 | "sebastian/environment": "^4.2.2", 500 | "sebastian/version": "^2.0.1", 501 | "theseer/tokenizer": "^1.1.3" 502 | }, 503 | "require-dev": { 504 | "phpunit/phpunit": "^8.2.2" 505 | }, 506 | "suggest": { 507 | "ext-xdebug": "^2.7.2" 508 | }, 509 | "type": "library", 510 | "extra": { 511 | "branch-alias": { 512 | "dev-master": "7.0-dev" 513 | } 514 | }, 515 | "autoload": { 516 | "classmap": [ 517 | "src/" 518 | ] 519 | }, 520 | "notification-url": "https://packagist.org/downloads/", 521 | "license": [ 522 | "BSD-3-Clause" 523 | ], 524 | "authors": [ 525 | { 526 | "name": "Sebastian Bergmann", 527 | "email": "sebastian@phpunit.de", 528 | "role": "lead" 529 | } 530 | ], 531 | "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", 532 | "homepage": "https://github.com/sebastianbergmann/php-code-coverage", 533 | "keywords": [ 534 | "coverage", 535 | "testing", 536 | "xunit" 537 | ], 538 | "support": { 539 | "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", 540 | "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/7.0.15" 541 | }, 542 | "funding": [ 543 | { 544 | "url": "https://github.com/sebastianbergmann", 545 | "type": "github" 546 | } 547 | ], 548 | "time": "2021-07-26T12:20:09+00:00" 549 | }, 550 | { 551 | "name": "phpunit/php-file-iterator", 552 | "version": "2.0.5", 553 | "source": { 554 | "type": "git", 555 | "url": "https://github.com/sebastianbergmann/php-file-iterator.git", 556 | "reference": "42c5ba5220e6904cbfe8b1a1bda7c0cfdc8c12f5" 557 | }, 558 | "dist": { 559 | "type": "zip", 560 | "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/42c5ba5220e6904cbfe8b1a1bda7c0cfdc8c12f5", 561 | "reference": "42c5ba5220e6904cbfe8b1a1bda7c0cfdc8c12f5", 562 | "shasum": "" 563 | }, 564 | "require": { 565 | "php": ">=7.1" 566 | }, 567 | "require-dev": { 568 | "phpunit/phpunit": "^8.5" 569 | }, 570 | "type": "library", 571 | "extra": { 572 | "branch-alias": { 573 | "dev-master": "2.0.x-dev" 574 | } 575 | }, 576 | "autoload": { 577 | "classmap": [ 578 | "src/" 579 | ] 580 | }, 581 | "notification-url": "https://packagist.org/downloads/", 582 | "license": [ 583 | "BSD-3-Clause" 584 | ], 585 | "authors": [ 586 | { 587 | "name": "Sebastian Bergmann", 588 | "email": "sebastian@phpunit.de", 589 | "role": "lead" 590 | } 591 | ], 592 | "description": "FilterIterator implementation that filters files based on a list of suffixes.", 593 | "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", 594 | "keywords": [ 595 | "filesystem", 596 | "iterator" 597 | ], 598 | "support": { 599 | "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", 600 | "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/2.0.5" 601 | }, 602 | "funding": [ 603 | { 604 | "url": "https://github.com/sebastianbergmann", 605 | "type": "github" 606 | } 607 | ], 608 | "time": "2021-12-02T12:42:26+00:00" 609 | }, 610 | { 611 | "name": "phpunit/php-text-template", 612 | "version": "1.2.1", 613 | "source": { 614 | "type": "git", 615 | "url": "https://github.com/sebastianbergmann/php-text-template.git", 616 | "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" 617 | }, 618 | "dist": { 619 | "type": "zip", 620 | "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", 621 | "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", 622 | "shasum": "" 623 | }, 624 | "require": { 625 | "php": ">=5.3.3" 626 | }, 627 | "type": "library", 628 | "autoload": { 629 | "classmap": [ 630 | "src/" 631 | ] 632 | }, 633 | "notification-url": "https://packagist.org/downloads/", 634 | "license": [ 635 | "BSD-3-Clause" 636 | ], 637 | "authors": [ 638 | { 639 | "name": "Sebastian Bergmann", 640 | "email": "sebastian@phpunit.de", 641 | "role": "lead" 642 | } 643 | ], 644 | "description": "Simple template engine.", 645 | "homepage": "https://github.com/sebastianbergmann/php-text-template/", 646 | "keywords": [ 647 | "template" 648 | ], 649 | "support": { 650 | "issues": "https://github.com/sebastianbergmann/php-text-template/issues", 651 | "source": "https://github.com/sebastianbergmann/php-text-template/tree/1.2.1" 652 | }, 653 | "time": "2015-06-21T13:50:34+00:00" 654 | }, 655 | { 656 | "name": "phpunit/php-timer", 657 | "version": "2.1.3", 658 | "source": { 659 | "type": "git", 660 | "url": "https://github.com/sebastianbergmann/php-timer.git", 661 | "reference": "2454ae1765516d20c4ffe103d85a58a9a3bd5662" 662 | }, 663 | "dist": { 664 | "type": "zip", 665 | "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/2454ae1765516d20c4ffe103d85a58a9a3bd5662", 666 | "reference": "2454ae1765516d20c4ffe103d85a58a9a3bd5662", 667 | "shasum": "" 668 | }, 669 | "require": { 670 | "php": ">=7.1" 671 | }, 672 | "require-dev": { 673 | "phpunit/phpunit": "^8.5" 674 | }, 675 | "type": "library", 676 | "extra": { 677 | "branch-alias": { 678 | "dev-master": "2.1-dev" 679 | } 680 | }, 681 | "autoload": { 682 | "classmap": [ 683 | "src/" 684 | ] 685 | }, 686 | "notification-url": "https://packagist.org/downloads/", 687 | "license": [ 688 | "BSD-3-Clause" 689 | ], 690 | "authors": [ 691 | { 692 | "name": "Sebastian Bergmann", 693 | "email": "sebastian@phpunit.de", 694 | "role": "lead" 695 | } 696 | ], 697 | "description": "Utility class for timing", 698 | "homepage": "https://github.com/sebastianbergmann/php-timer/", 699 | "keywords": [ 700 | "timer" 701 | ], 702 | "support": { 703 | "issues": "https://github.com/sebastianbergmann/php-timer/issues", 704 | "source": "https://github.com/sebastianbergmann/php-timer/tree/2.1.3" 705 | }, 706 | "funding": [ 707 | { 708 | "url": "https://github.com/sebastianbergmann", 709 | "type": "github" 710 | } 711 | ], 712 | "time": "2020-11-30T08:20:02+00:00" 713 | }, 714 | { 715 | "name": "phpunit/php-token-stream", 716 | "version": "4.0.4", 717 | "source": { 718 | "type": "git", 719 | "url": "https://github.com/sebastianbergmann/php-token-stream.git", 720 | "reference": "a853a0e183b9db7eed023d7933a858fa1c8d25a3" 721 | }, 722 | "dist": { 723 | "type": "zip", 724 | "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/a853a0e183b9db7eed023d7933a858fa1c8d25a3", 725 | "reference": "a853a0e183b9db7eed023d7933a858fa1c8d25a3", 726 | "shasum": "" 727 | }, 728 | "require": { 729 | "ext-tokenizer": "*", 730 | "php": "^7.3 || ^8.0" 731 | }, 732 | "require-dev": { 733 | "phpunit/phpunit": "^9.0" 734 | }, 735 | "type": "library", 736 | "extra": { 737 | "branch-alias": { 738 | "dev-master": "4.0-dev" 739 | } 740 | }, 741 | "autoload": { 742 | "classmap": [ 743 | "src/" 744 | ] 745 | }, 746 | "notification-url": "https://packagist.org/downloads/", 747 | "license": [ 748 | "BSD-3-Clause" 749 | ], 750 | "authors": [ 751 | { 752 | "name": "Sebastian Bergmann", 753 | "email": "sebastian@phpunit.de" 754 | } 755 | ], 756 | "description": "Wrapper around PHP's tokenizer extension.", 757 | "homepage": "https://github.com/sebastianbergmann/php-token-stream/", 758 | "keywords": [ 759 | "tokenizer" 760 | ], 761 | "support": { 762 | "issues": "https://github.com/sebastianbergmann/php-token-stream/issues", 763 | "source": "https://github.com/sebastianbergmann/php-token-stream/tree/master" 764 | }, 765 | "funding": [ 766 | { 767 | "url": "https://github.com/sebastianbergmann", 768 | "type": "github" 769 | } 770 | ], 771 | "abandoned": true, 772 | "time": "2020-08-04T08:28:15+00:00" 773 | }, 774 | { 775 | "name": "phpunit/phpunit", 776 | "version": "8.5.26", 777 | "source": { 778 | "type": "git", 779 | "url": "https://github.com/sebastianbergmann/phpunit.git", 780 | "reference": "ef117c59fc4c54a979021b26d08a3373e386606d" 781 | }, 782 | "dist": { 783 | "type": "zip", 784 | "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/ef117c59fc4c54a979021b26d08a3373e386606d", 785 | "reference": "ef117c59fc4c54a979021b26d08a3373e386606d", 786 | "shasum": "" 787 | }, 788 | "require": { 789 | "doctrine/instantiator": "^1.3.1", 790 | "ext-dom": "*", 791 | "ext-json": "*", 792 | "ext-libxml": "*", 793 | "ext-mbstring": "*", 794 | "ext-xml": "*", 795 | "ext-xmlwriter": "*", 796 | "myclabs/deep-copy": "^1.10.0", 797 | "phar-io/manifest": "^2.0.3", 798 | "phar-io/version": "^3.0.2", 799 | "php": ">=7.2", 800 | "phpspec/prophecy": "^1.10.3", 801 | "phpunit/php-code-coverage": "^7.0.12", 802 | "phpunit/php-file-iterator": "^2.0.4", 803 | "phpunit/php-text-template": "^1.2.1", 804 | "phpunit/php-timer": "^2.1.2", 805 | "sebastian/comparator": "^3.0.2", 806 | "sebastian/diff": "^3.0.2", 807 | "sebastian/environment": "^4.2.3", 808 | "sebastian/exporter": "^3.1.2", 809 | "sebastian/global-state": "^3.0.0", 810 | "sebastian/object-enumerator": "^3.0.3", 811 | "sebastian/resource-operations": "^2.0.1", 812 | "sebastian/type": "^1.1.3", 813 | "sebastian/version": "^2.0.1" 814 | }, 815 | "require-dev": { 816 | "ext-pdo": "*" 817 | }, 818 | "suggest": { 819 | "ext-soap": "*", 820 | "ext-xdebug": "*", 821 | "phpunit/php-invoker": "^2.0.0" 822 | }, 823 | "bin": [ 824 | "phpunit" 825 | ], 826 | "type": "library", 827 | "extra": { 828 | "branch-alias": { 829 | "dev-master": "8.5-dev" 830 | } 831 | }, 832 | "autoload": { 833 | "classmap": [ 834 | "src/" 835 | ] 836 | }, 837 | "notification-url": "https://packagist.org/downloads/", 838 | "license": [ 839 | "BSD-3-Clause" 840 | ], 841 | "authors": [ 842 | { 843 | "name": "Sebastian Bergmann", 844 | "email": "sebastian@phpunit.de", 845 | "role": "lead" 846 | } 847 | ], 848 | "description": "The PHP Unit Testing framework.", 849 | "homepage": "https://phpunit.de/", 850 | "keywords": [ 851 | "phpunit", 852 | "testing", 853 | "xunit" 854 | ], 855 | "support": { 856 | "issues": "https://github.com/sebastianbergmann/phpunit/issues", 857 | "source": "https://github.com/sebastianbergmann/phpunit/tree/8.5.26" 858 | }, 859 | "funding": [ 860 | { 861 | "url": "https://phpunit.de/sponsors.html", 862 | "type": "custom" 863 | }, 864 | { 865 | "url": "https://github.com/sebastianbergmann", 866 | "type": "github" 867 | } 868 | ], 869 | "time": "2022-04-01T12:34:39+00:00" 870 | }, 871 | { 872 | "name": "sebastian/code-unit-reverse-lookup", 873 | "version": "1.0.2", 874 | "source": { 875 | "type": "git", 876 | "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", 877 | "reference": "1de8cd5c010cb153fcd68b8d0f64606f523f7619" 878 | }, 879 | "dist": { 880 | "type": "zip", 881 | "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/1de8cd5c010cb153fcd68b8d0f64606f523f7619", 882 | "reference": "1de8cd5c010cb153fcd68b8d0f64606f523f7619", 883 | "shasum": "" 884 | }, 885 | "require": { 886 | "php": ">=5.6" 887 | }, 888 | "require-dev": { 889 | "phpunit/phpunit": "^8.5" 890 | }, 891 | "type": "library", 892 | "extra": { 893 | "branch-alias": { 894 | "dev-master": "1.0.x-dev" 895 | } 896 | }, 897 | "autoload": { 898 | "classmap": [ 899 | "src/" 900 | ] 901 | }, 902 | "notification-url": "https://packagist.org/downloads/", 903 | "license": [ 904 | "BSD-3-Clause" 905 | ], 906 | "authors": [ 907 | { 908 | "name": "Sebastian Bergmann", 909 | "email": "sebastian@phpunit.de" 910 | } 911 | ], 912 | "description": "Looks up which function or method a line of code belongs to", 913 | "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", 914 | "support": { 915 | "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", 916 | "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/1.0.2" 917 | }, 918 | "funding": [ 919 | { 920 | "url": "https://github.com/sebastianbergmann", 921 | "type": "github" 922 | } 923 | ], 924 | "time": "2020-11-30T08:15:22+00:00" 925 | }, 926 | { 927 | "name": "sebastian/comparator", 928 | "version": "3.0.3", 929 | "source": { 930 | "type": "git", 931 | "url": "https://github.com/sebastianbergmann/comparator.git", 932 | "reference": "1071dfcef776a57013124ff35e1fc41ccd294758" 933 | }, 934 | "dist": { 935 | "type": "zip", 936 | "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/1071dfcef776a57013124ff35e1fc41ccd294758", 937 | "reference": "1071dfcef776a57013124ff35e1fc41ccd294758", 938 | "shasum": "" 939 | }, 940 | "require": { 941 | "php": ">=7.1", 942 | "sebastian/diff": "^3.0", 943 | "sebastian/exporter": "^3.1" 944 | }, 945 | "require-dev": { 946 | "phpunit/phpunit": "^8.5" 947 | }, 948 | "type": "library", 949 | "extra": { 950 | "branch-alias": { 951 | "dev-master": "3.0-dev" 952 | } 953 | }, 954 | "autoload": { 955 | "classmap": [ 956 | "src/" 957 | ] 958 | }, 959 | "notification-url": "https://packagist.org/downloads/", 960 | "license": [ 961 | "BSD-3-Clause" 962 | ], 963 | "authors": [ 964 | { 965 | "name": "Sebastian Bergmann", 966 | "email": "sebastian@phpunit.de" 967 | }, 968 | { 969 | "name": "Jeff Welch", 970 | "email": "whatthejeff@gmail.com" 971 | }, 972 | { 973 | "name": "Volker Dusch", 974 | "email": "github@wallbash.com" 975 | }, 976 | { 977 | "name": "Bernhard Schussek", 978 | "email": "bschussek@2bepublished.at" 979 | } 980 | ], 981 | "description": "Provides the functionality to compare PHP values for equality", 982 | "homepage": "https://github.com/sebastianbergmann/comparator", 983 | "keywords": [ 984 | "comparator", 985 | "compare", 986 | "equality" 987 | ], 988 | "support": { 989 | "issues": "https://github.com/sebastianbergmann/comparator/issues", 990 | "source": "https://github.com/sebastianbergmann/comparator/tree/3.0.3" 991 | }, 992 | "funding": [ 993 | { 994 | "url": "https://github.com/sebastianbergmann", 995 | "type": "github" 996 | } 997 | ], 998 | "time": "2020-11-30T08:04:30+00:00" 999 | }, 1000 | { 1001 | "name": "sebastian/diff", 1002 | "version": "3.0.3", 1003 | "source": { 1004 | "type": "git", 1005 | "url": "https://github.com/sebastianbergmann/diff.git", 1006 | "reference": "14f72dd46eaf2f2293cbe79c93cc0bc43161a211" 1007 | }, 1008 | "dist": { 1009 | "type": "zip", 1010 | "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/14f72dd46eaf2f2293cbe79c93cc0bc43161a211", 1011 | "reference": "14f72dd46eaf2f2293cbe79c93cc0bc43161a211", 1012 | "shasum": "" 1013 | }, 1014 | "require": { 1015 | "php": ">=7.1" 1016 | }, 1017 | "require-dev": { 1018 | "phpunit/phpunit": "^7.5 || ^8.0", 1019 | "symfony/process": "^2 || ^3.3 || ^4" 1020 | }, 1021 | "type": "library", 1022 | "extra": { 1023 | "branch-alias": { 1024 | "dev-master": "3.0-dev" 1025 | } 1026 | }, 1027 | "autoload": { 1028 | "classmap": [ 1029 | "src/" 1030 | ] 1031 | }, 1032 | "notification-url": "https://packagist.org/downloads/", 1033 | "license": [ 1034 | "BSD-3-Clause" 1035 | ], 1036 | "authors": [ 1037 | { 1038 | "name": "Sebastian Bergmann", 1039 | "email": "sebastian@phpunit.de" 1040 | }, 1041 | { 1042 | "name": "Kore Nordmann", 1043 | "email": "mail@kore-nordmann.de" 1044 | } 1045 | ], 1046 | "description": "Diff implementation", 1047 | "homepage": "https://github.com/sebastianbergmann/diff", 1048 | "keywords": [ 1049 | "diff", 1050 | "udiff", 1051 | "unidiff", 1052 | "unified diff" 1053 | ], 1054 | "support": { 1055 | "issues": "https://github.com/sebastianbergmann/diff/issues", 1056 | "source": "https://github.com/sebastianbergmann/diff/tree/3.0.3" 1057 | }, 1058 | "funding": [ 1059 | { 1060 | "url": "https://github.com/sebastianbergmann", 1061 | "type": "github" 1062 | } 1063 | ], 1064 | "time": "2020-11-30T07:59:04+00:00" 1065 | }, 1066 | { 1067 | "name": "sebastian/environment", 1068 | "version": "4.2.4", 1069 | "source": { 1070 | "type": "git", 1071 | "url": "https://github.com/sebastianbergmann/environment.git", 1072 | "reference": "d47bbbad83711771f167c72d4e3f25f7fcc1f8b0" 1073 | }, 1074 | "dist": { 1075 | "type": "zip", 1076 | "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/d47bbbad83711771f167c72d4e3f25f7fcc1f8b0", 1077 | "reference": "d47bbbad83711771f167c72d4e3f25f7fcc1f8b0", 1078 | "shasum": "" 1079 | }, 1080 | "require": { 1081 | "php": ">=7.1" 1082 | }, 1083 | "require-dev": { 1084 | "phpunit/phpunit": "^7.5" 1085 | }, 1086 | "suggest": { 1087 | "ext-posix": "*" 1088 | }, 1089 | "type": "library", 1090 | "extra": { 1091 | "branch-alias": { 1092 | "dev-master": "4.2-dev" 1093 | } 1094 | }, 1095 | "autoload": { 1096 | "classmap": [ 1097 | "src/" 1098 | ] 1099 | }, 1100 | "notification-url": "https://packagist.org/downloads/", 1101 | "license": [ 1102 | "BSD-3-Clause" 1103 | ], 1104 | "authors": [ 1105 | { 1106 | "name": "Sebastian Bergmann", 1107 | "email": "sebastian@phpunit.de" 1108 | } 1109 | ], 1110 | "description": "Provides functionality to handle HHVM/PHP environments", 1111 | "homepage": "http://www.github.com/sebastianbergmann/environment", 1112 | "keywords": [ 1113 | "Xdebug", 1114 | "environment", 1115 | "hhvm" 1116 | ], 1117 | "support": { 1118 | "issues": "https://github.com/sebastianbergmann/environment/issues", 1119 | "source": "https://github.com/sebastianbergmann/environment/tree/4.2.4" 1120 | }, 1121 | "funding": [ 1122 | { 1123 | "url": "https://github.com/sebastianbergmann", 1124 | "type": "github" 1125 | } 1126 | ], 1127 | "time": "2020-11-30T07:53:42+00:00" 1128 | }, 1129 | { 1130 | "name": "sebastian/exporter", 1131 | "version": "3.1.4", 1132 | "source": { 1133 | "type": "git", 1134 | "url": "https://github.com/sebastianbergmann/exporter.git", 1135 | "reference": "0c32ea2e40dbf59de29f3b49bf375176ce7dd8db" 1136 | }, 1137 | "dist": { 1138 | "type": "zip", 1139 | "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/0c32ea2e40dbf59de29f3b49bf375176ce7dd8db", 1140 | "reference": "0c32ea2e40dbf59de29f3b49bf375176ce7dd8db", 1141 | "shasum": "" 1142 | }, 1143 | "require": { 1144 | "php": ">=7.0", 1145 | "sebastian/recursion-context": "^3.0" 1146 | }, 1147 | "require-dev": { 1148 | "ext-mbstring": "*", 1149 | "phpunit/phpunit": "^8.5" 1150 | }, 1151 | "type": "library", 1152 | "extra": { 1153 | "branch-alias": { 1154 | "dev-master": "3.1.x-dev" 1155 | } 1156 | }, 1157 | "autoload": { 1158 | "classmap": [ 1159 | "src/" 1160 | ] 1161 | }, 1162 | "notification-url": "https://packagist.org/downloads/", 1163 | "license": [ 1164 | "BSD-3-Clause" 1165 | ], 1166 | "authors": [ 1167 | { 1168 | "name": "Sebastian Bergmann", 1169 | "email": "sebastian@phpunit.de" 1170 | }, 1171 | { 1172 | "name": "Jeff Welch", 1173 | "email": "whatthejeff@gmail.com" 1174 | }, 1175 | { 1176 | "name": "Volker Dusch", 1177 | "email": "github@wallbash.com" 1178 | }, 1179 | { 1180 | "name": "Adam Harvey", 1181 | "email": "aharvey@php.net" 1182 | }, 1183 | { 1184 | "name": "Bernhard Schussek", 1185 | "email": "bschussek@gmail.com" 1186 | } 1187 | ], 1188 | "description": "Provides the functionality to export PHP variables for visualization", 1189 | "homepage": "http://www.github.com/sebastianbergmann/exporter", 1190 | "keywords": [ 1191 | "export", 1192 | "exporter" 1193 | ], 1194 | "support": { 1195 | "issues": "https://github.com/sebastianbergmann/exporter/issues", 1196 | "source": "https://github.com/sebastianbergmann/exporter/tree/3.1.4" 1197 | }, 1198 | "funding": [ 1199 | { 1200 | "url": "https://github.com/sebastianbergmann", 1201 | "type": "github" 1202 | } 1203 | ], 1204 | "time": "2021-11-11T13:51:24+00:00" 1205 | }, 1206 | { 1207 | "name": "sebastian/global-state", 1208 | "version": "3.0.2", 1209 | "source": { 1210 | "type": "git", 1211 | "url": "https://github.com/sebastianbergmann/global-state.git", 1212 | "reference": "de036ec91d55d2a9e0db2ba975b512cdb1c23921" 1213 | }, 1214 | "dist": { 1215 | "type": "zip", 1216 | "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/de036ec91d55d2a9e0db2ba975b512cdb1c23921", 1217 | "reference": "de036ec91d55d2a9e0db2ba975b512cdb1c23921", 1218 | "shasum": "" 1219 | }, 1220 | "require": { 1221 | "php": ">=7.2", 1222 | "sebastian/object-reflector": "^1.1.1", 1223 | "sebastian/recursion-context": "^3.0" 1224 | }, 1225 | "require-dev": { 1226 | "ext-dom": "*", 1227 | "phpunit/phpunit": "^8.0" 1228 | }, 1229 | "suggest": { 1230 | "ext-uopz": "*" 1231 | }, 1232 | "type": "library", 1233 | "extra": { 1234 | "branch-alias": { 1235 | "dev-master": "3.0-dev" 1236 | } 1237 | }, 1238 | "autoload": { 1239 | "classmap": [ 1240 | "src/" 1241 | ] 1242 | }, 1243 | "notification-url": "https://packagist.org/downloads/", 1244 | "license": [ 1245 | "BSD-3-Clause" 1246 | ], 1247 | "authors": [ 1248 | { 1249 | "name": "Sebastian Bergmann", 1250 | "email": "sebastian@phpunit.de" 1251 | } 1252 | ], 1253 | "description": "Snapshotting of global state", 1254 | "homepage": "http://www.github.com/sebastianbergmann/global-state", 1255 | "keywords": [ 1256 | "global state" 1257 | ], 1258 | "support": { 1259 | "issues": "https://github.com/sebastianbergmann/global-state/issues", 1260 | "source": "https://github.com/sebastianbergmann/global-state/tree/3.0.2" 1261 | }, 1262 | "funding": [ 1263 | { 1264 | "url": "https://github.com/sebastianbergmann", 1265 | "type": "github" 1266 | } 1267 | ], 1268 | "time": "2022-02-10T06:55:38+00:00" 1269 | }, 1270 | { 1271 | "name": "sebastian/object-enumerator", 1272 | "version": "3.0.4", 1273 | "source": { 1274 | "type": "git", 1275 | "url": "https://github.com/sebastianbergmann/object-enumerator.git", 1276 | "reference": "e67f6d32ebd0c749cf9d1dbd9f226c727043cdf2" 1277 | }, 1278 | "dist": { 1279 | "type": "zip", 1280 | "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/e67f6d32ebd0c749cf9d1dbd9f226c727043cdf2", 1281 | "reference": "e67f6d32ebd0c749cf9d1dbd9f226c727043cdf2", 1282 | "shasum": "" 1283 | }, 1284 | "require": { 1285 | "php": ">=7.0", 1286 | "sebastian/object-reflector": "^1.1.1", 1287 | "sebastian/recursion-context": "^3.0" 1288 | }, 1289 | "require-dev": { 1290 | "phpunit/phpunit": "^6.0" 1291 | }, 1292 | "type": "library", 1293 | "extra": { 1294 | "branch-alias": { 1295 | "dev-master": "3.0.x-dev" 1296 | } 1297 | }, 1298 | "autoload": { 1299 | "classmap": [ 1300 | "src/" 1301 | ] 1302 | }, 1303 | "notification-url": "https://packagist.org/downloads/", 1304 | "license": [ 1305 | "BSD-3-Clause" 1306 | ], 1307 | "authors": [ 1308 | { 1309 | "name": "Sebastian Bergmann", 1310 | "email": "sebastian@phpunit.de" 1311 | } 1312 | ], 1313 | "description": "Traverses array structures and object graphs to enumerate all referenced objects", 1314 | "homepage": "https://github.com/sebastianbergmann/object-enumerator/", 1315 | "support": { 1316 | "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", 1317 | "source": "https://github.com/sebastianbergmann/object-enumerator/tree/3.0.4" 1318 | }, 1319 | "funding": [ 1320 | { 1321 | "url": "https://github.com/sebastianbergmann", 1322 | "type": "github" 1323 | } 1324 | ], 1325 | "time": "2020-11-30T07:40:27+00:00" 1326 | }, 1327 | { 1328 | "name": "sebastian/object-reflector", 1329 | "version": "1.1.2", 1330 | "source": { 1331 | "type": "git", 1332 | "url": "https://github.com/sebastianbergmann/object-reflector.git", 1333 | "reference": "9b8772b9cbd456ab45d4a598d2dd1a1bced6363d" 1334 | }, 1335 | "dist": { 1336 | "type": "zip", 1337 | "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/9b8772b9cbd456ab45d4a598d2dd1a1bced6363d", 1338 | "reference": "9b8772b9cbd456ab45d4a598d2dd1a1bced6363d", 1339 | "shasum": "" 1340 | }, 1341 | "require": { 1342 | "php": ">=7.0" 1343 | }, 1344 | "require-dev": { 1345 | "phpunit/phpunit": "^6.0" 1346 | }, 1347 | "type": "library", 1348 | "extra": { 1349 | "branch-alias": { 1350 | "dev-master": "1.1-dev" 1351 | } 1352 | }, 1353 | "autoload": { 1354 | "classmap": [ 1355 | "src/" 1356 | ] 1357 | }, 1358 | "notification-url": "https://packagist.org/downloads/", 1359 | "license": [ 1360 | "BSD-3-Clause" 1361 | ], 1362 | "authors": [ 1363 | { 1364 | "name": "Sebastian Bergmann", 1365 | "email": "sebastian@phpunit.de" 1366 | } 1367 | ], 1368 | "description": "Allows reflection of object attributes, including inherited and non-public ones", 1369 | "homepage": "https://github.com/sebastianbergmann/object-reflector/", 1370 | "support": { 1371 | "issues": "https://github.com/sebastianbergmann/object-reflector/issues", 1372 | "source": "https://github.com/sebastianbergmann/object-reflector/tree/1.1.2" 1373 | }, 1374 | "funding": [ 1375 | { 1376 | "url": "https://github.com/sebastianbergmann", 1377 | "type": "github" 1378 | } 1379 | ], 1380 | "time": "2020-11-30T07:37:18+00:00" 1381 | }, 1382 | { 1383 | "name": "sebastian/recursion-context", 1384 | "version": "3.0.1", 1385 | "source": { 1386 | "type": "git", 1387 | "url": "https://github.com/sebastianbergmann/recursion-context.git", 1388 | "reference": "367dcba38d6e1977be014dc4b22f47a484dac7fb" 1389 | }, 1390 | "dist": { 1391 | "type": "zip", 1392 | "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/367dcba38d6e1977be014dc4b22f47a484dac7fb", 1393 | "reference": "367dcba38d6e1977be014dc4b22f47a484dac7fb", 1394 | "shasum": "" 1395 | }, 1396 | "require": { 1397 | "php": ">=7.0" 1398 | }, 1399 | "require-dev": { 1400 | "phpunit/phpunit": "^6.0" 1401 | }, 1402 | "type": "library", 1403 | "extra": { 1404 | "branch-alias": { 1405 | "dev-master": "3.0.x-dev" 1406 | } 1407 | }, 1408 | "autoload": { 1409 | "classmap": [ 1410 | "src/" 1411 | ] 1412 | }, 1413 | "notification-url": "https://packagist.org/downloads/", 1414 | "license": [ 1415 | "BSD-3-Clause" 1416 | ], 1417 | "authors": [ 1418 | { 1419 | "name": "Sebastian Bergmann", 1420 | "email": "sebastian@phpunit.de" 1421 | }, 1422 | { 1423 | "name": "Jeff Welch", 1424 | "email": "whatthejeff@gmail.com" 1425 | }, 1426 | { 1427 | "name": "Adam Harvey", 1428 | "email": "aharvey@php.net" 1429 | } 1430 | ], 1431 | "description": "Provides functionality to recursively process PHP variables", 1432 | "homepage": "http://www.github.com/sebastianbergmann/recursion-context", 1433 | "support": { 1434 | "issues": "https://github.com/sebastianbergmann/recursion-context/issues", 1435 | "source": "https://github.com/sebastianbergmann/recursion-context/tree/3.0.1" 1436 | }, 1437 | "funding": [ 1438 | { 1439 | "url": "https://github.com/sebastianbergmann", 1440 | "type": "github" 1441 | } 1442 | ], 1443 | "time": "2020-11-30T07:34:24+00:00" 1444 | }, 1445 | { 1446 | "name": "sebastian/resource-operations", 1447 | "version": "2.0.2", 1448 | "source": { 1449 | "type": "git", 1450 | "url": "https://github.com/sebastianbergmann/resource-operations.git", 1451 | "reference": "31d35ca87926450c44eae7e2611d45a7a65ea8b3" 1452 | }, 1453 | "dist": { 1454 | "type": "zip", 1455 | "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/31d35ca87926450c44eae7e2611d45a7a65ea8b3", 1456 | "reference": "31d35ca87926450c44eae7e2611d45a7a65ea8b3", 1457 | "shasum": "" 1458 | }, 1459 | "require": { 1460 | "php": ">=7.1" 1461 | }, 1462 | "type": "library", 1463 | "extra": { 1464 | "branch-alias": { 1465 | "dev-master": "2.0-dev" 1466 | } 1467 | }, 1468 | "autoload": { 1469 | "classmap": [ 1470 | "src/" 1471 | ] 1472 | }, 1473 | "notification-url": "https://packagist.org/downloads/", 1474 | "license": [ 1475 | "BSD-3-Clause" 1476 | ], 1477 | "authors": [ 1478 | { 1479 | "name": "Sebastian Bergmann", 1480 | "email": "sebastian@phpunit.de" 1481 | } 1482 | ], 1483 | "description": "Provides a list of PHP built-in functions that operate on resources", 1484 | "homepage": "https://www.github.com/sebastianbergmann/resource-operations", 1485 | "support": { 1486 | "issues": "https://github.com/sebastianbergmann/resource-operations/issues", 1487 | "source": "https://github.com/sebastianbergmann/resource-operations/tree/2.0.2" 1488 | }, 1489 | "funding": [ 1490 | { 1491 | "url": "https://github.com/sebastianbergmann", 1492 | "type": "github" 1493 | } 1494 | ], 1495 | "time": "2020-11-30T07:30:19+00:00" 1496 | }, 1497 | { 1498 | "name": "sebastian/type", 1499 | "version": "1.1.4", 1500 | "source": { 1501 | "type": "git", 1502 | "url": "https://github.com/sebastianbergmann/type.git", 1503 | "reference": "0150cfbc4495ed2df3872fb31b26781e4e077eb4" 1504 | }, 1505 | "dist": { 1506 | "type": "zip", 1507 | "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/0150cfbc4495ed2df3872fb31b26781e4e077eb4", 1508 | "reference": "0150cfbc4495ed2df3872fb31b26781e4e077eb4", 1509 | "shasum": "" 1510 | }, 1511 | "require": { 1512 | "php": ">=7.2" 1513 | }, 1514 | "require-dev": { 1515 | "phpunit/phpunit": "^8.2" 1516 | }, 1517 | "type": "library", 1518 | "extra": { 1519 | "branch-alias": { 1520 | "dev-master": "1.1-dev" 1521 | } 1522 | }, 1523 | "autoload": { 1524 | "classmap": [ 1525 | "src/" 1526 | ] 1527 | }, 1528 | "notification-url": "https://packagist.org/downloads/", 1529 | "license": [ 1530 | "BSD-3-Clause" 1531 | ], 1532 | "authors": [ 1533 | { 1534 | "name": "Sebastian Bergmann", 1535 | "email": "sebastian@phpunit.de", 1536 | "role": "lead" 1537 | } 1538 | ], 1539 | "description": "Collection of value objects that represent the types of the PHP type system", 1540 | "homepage": "https://github.com/sebastianbergmann/type", 1541 | "support": { 1542 | "issues": "https://github.com/sebastianbergmann/type/issues", 1543 | "source": "https://github.com/sebastianbergmann/type/tree/1.1.4" 1544 | }, 1545 | "funding": [ 1546 | { 1547 | "url": "https://github.com/sebastianbergmann", 1548 | "type": "github" 1549 | } 1550 | ], 1551 | "time": "2020-11-30T07:25:11+00:00" 1552 | }, 1553 | { 1554 | "name": "sebastian/version", 1555 | "version": "2.0.1", 1556 | "source": { 1557 | "type": "git", 1558 | "url": "https://github.com/sebastianbergmann/version.git", 1559 | "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019" 1560 | }, 1561 | "dist": { 1562 | "type": "zip", 1563 | "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019", 1564 | "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019", 1565 | "shasum": "" 1566 | }, 1567 | "require": { 1568 | "php": ">=5.6" 1569 | }, 1570 | "type": "library", 1571 | "extra": { 1572 | "branch-alias": { 1573 | "dev-master": "2.0.x-dev" 1574 | } 1575 | }, 1576 | "autoload": { 1577 | "classmap": [ 1578 | "src/" 1579 | ] 1580 | }, 1581 | "notification-url": "https://packagist.org/downloads/", 1582 | "license": [ 1583 | "BSD-3-Clause" 1584 | ], 1585 | "authors": [ 1586 | { 1587 | "name": "Sebastian Bergmann", 1588 | "email": "sebastian@phpunit.de", 1589 | "role": "lead" 1590 | } 1591 | ], 1592 | "description": "Library that helps with managing the version number of Git-hosted PHP projects", 1593 | "homepage": "https://github.com/sebastianbergmann/version", 1594 | "support": { 1595 | "issues": "https://github.com/sebastianbergmann/version/issues", 1596 | "source": "https://github.com/sebastianbergmann/version/tree/master" 1597 | }, 1598 | "time": "2016-10-03T07:35:21+00:00" 1599 | }, 1600 | { 1601 | "name": "squizlabs/php_codesniffer", 1602 | "version": "3.6.2", 1603 | "source": { 1604 | "type": "git", 1605 | "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", 1606 | "reference": "5e4e71592f69da17871dba6e80dd51bce74a351a" 1607 | }, 1608 | "dist": { 1609 | "type": "zip", 1610 | "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/5e4e71592f69da17871dba6e80dd51bce74a351a", 1611 | "reference": "5e4e71592f69da17871dba6e80dd51bce74a351a", 1612 | "shasum": "" 1613 | }, 1614 | "require": { 1615 | "ext-simplexml": "*", 1616 | "ext-tokenizer": "*", 1617 | "ext-xmlwriter": "*", 1618 | "php": ">=5.4.0" 1619 | }, 1620 | "require-dev": { 1621 | "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" 1622 | }, 1623 | "bin": [ 1624 | "bin/phpcs", 1625 | "bin/phpcbf" 1626 | ], 1627 | "type": "library", 1628 | "extra": { 1629 | "branch-alias": { 1630 | "dev-master": "3.x-dev" 1631 | } 1632 | }, 1633 | "notification-url": "https://packagist.org/downloads/", 1634 | "license": [ 1635 | "BSD-3-Clause" 1636 | ], 1637 | "authors": [ 1638 | { 1639 | "name": "Greg Sherwood", 1640 | "role": "lead" 1641 | } 1642 | ], 1643 | "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", 1644 | "homepage": "https://github.com/squizlabs/PHP_CodeSniffer", 1645 | "keywords": [ 1646 | "phpcs", 1647 | "standards" 1648 | ], 1649 | "support": { 1650 | "issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues", 1651 | "source": "https://github.com/squizlabs/PHP_CodeSniffer", 1652 | "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki" 1653 | }, 1654 | "time": "2021-12-12T21:44:58+00:00" 1655 | }, 1656 | { 1657 | "name": "symfony/polyfill-ctype", 1658 | "version": "v1.25.0", 1659 | "source": { 1660 | "type": "git", 1661 | "url": "https://github.com/symfony/polyfill-ctype.git", 1662 | "reference": "30885182c981ab175d4d034db0f6f469898070ab" 1663 | }, 1664 | "dist": { 1665 | "type": "zip", 1666 | "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/30885182c981ab175d4d034db0f6f469898070ab", 1667 | "reference": "30885182c981ab175d4d034db0f6f469898070ab", 1668 | "shasum": "" 1669 | }, 1670 | "require": { 1671 | "php": ">=7.1" 1672 | }, 1673 | "provide": { 1674 | "ext-ctype": "*" 1675 | }, 1676 | "suggest": { 1677 | "ext-ctype": "For best performance" 1678 | }, 1679 | "type": "library", 1680 | "extra": { 1681 | "branch-alias": { 1682 | "dev-main": "1.23-dev" 1683 | }, 1684 | "thanks": { 1685 | "name": "symfony/polyfill", 1686 | "url": "https://github.com/symfony/polyfill" 1687 | } 1688 | }, 1689 | "autoload": { 1690 | "files": [ 1691 | "bootstrap.php" 1692 | ], 1693 | "psr-4": { 1694 | "Symfony\\Polyfill\\Ctype\\": "" 1695 | } 1696 | }, 1697 | "notification-url": "https://packagist.org/downloads/", 1698 | "license": [ 1699 | "MIT" 1700 | ], 1701 | "authors": [ 1702 | { 1703 | "name": "Gert de Pagter", 1704 | "email": "BackEndTea@gmail.com" 1705 | }, 1706 | { 1707 | "name": "Symfony Community", 1708 | "homepage": "https://symfony.com/contributors" 1709 | } 1710 | ], 1711 | "description": "Symfony polyfill for ctype functions", 1712 | "homepage": "https://symfony.com", 1713 | "keywords": [ 1714 | "compatibility", 1715 | "ctype", 1716 | "polyfill", 1717 | "portable" 1718 | ], 1719 | "support": { 1720 | "source": "https://github.com/symfony/polyfill-ctype/tree/v1.25.0" 1721 | }, 1722 | "funding": [ 1723 | { 1724 | "url": "https://symfony.com/sponsor", 1725 | "type": "custom" 1726 | }, 1727 | { 1728 | "url": "https://github.com/fabpot", 1729 | "type": "github" 1730 | }, 1731 | { 1732 | "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", 1733 | "type": "tidelift" 1734 | } 1735 | ], 1736 | "time": "2021-10-20T20:35:02+00:00" 1737 | }, 1738 | { 1739 | "name": "theseer/tokenizer", 1740 | "version": "1.2.1", 1741 | "source": { 1742 | "type": "git", 1743 | "url": "https://github.com/theseer/tokenizer.git", 1744 | "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e" 1745 | }, 1746 | "dist": { 1747 | "type": "zip", 1748 | "url": "https://api.github.com/repos/theseer/tokenizer/zipball/34a41e998c2183e22995f158c581e7b5e755ab9e", 1749 | "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e", 1750 | "shasum": "" 1751 | }, 1752 | "require": { 1753 | "ext-dom": "*", 1754 | "ext-tokenizer": "*", 1755 | "ext-xmlwriter": "*", 1756 | "php": "^7.2 || ^8.0" 1757 | }, 1758 | "type": "library", 1759 | "autoload": { 1760 | "classmap": [ 1761 | "src/" 1762 | ] 1763 | }, 1764 | "notification-url": "https://packagist.org/downloads/", 1765 | "license": [ 1766 | "BSD-3-Clause" 1767 | ], 1768 | "authors": [ 1769 | { 1770 | "name": "Arne Blankerts", 1771 | "email": "arne@blankerts.de", 1772 | "role": "Developer" 1773 | } 1774 | ], 1775 | "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", 1776 | "support": { 1777 | "issues": "https://github.com/theseer/tokenizer/issues", 1778 | "source": "https://github.com/theseer/tokenizer/tree/1.2.1" 1779 | }, 1780 | "funding": [ 1781 | { 1782 | "url": "https://github.com/theseer", 1783 | "type": "github" 1784 | } 1785 | ], 1786 | "time": "2021-07-28T10:34:58+00:00" 1787 | }, 1788 | { 1789 | "name": "webmozart/assert", 1790 | "version": "1.10.0", 1791 | "source": { 1792 | "type": "git", 1793 | "url": "https://github.com/webmozarts/assert.git", 1794 | "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25" 1795 | }, 1796 | "dist": { 1797 | "type": "zip", 1798 | "url": "https://api.github.com/repos/webmozarts/assert/zipball/6964c76c7804814a842473e0c8fd15bab0f18e25", 1799 | "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25", 1800 | "shasum": "" 1801 | }, 1802 | "require": { 1803 | "php": "^7.2 || ^8.0", 1804 | "symfony/polyfill-ctype": "^1.8" 1805 | }, 1806 | "conflict": { 1807 | "phpstan/phpstan": "<0.12.20", 1808 | "vimeo/psalm": "<4.6.1 || 4.6.2" 1809 | }, 1810 | "require-dev": { 1811 | "phpunit/phpunit": "^8.5.13" 1812 | }, 1813 | "type": "library", 1814 | "extra": { 1815 | "branch-alias": { 1816 | "dev-master": "1.10-dev" 1817 | } 1818 | }, 1819 | "autoload": { 1820 | "psr-4": { 1821 | "Webmozart\\Assert\\": "src/" 1822 | } 1823 | }, 1824 | "notification-url": "https://packagist.org/downloads/", 1825 | "license": [ 1826 | "MIT" 1827 | ], 1828 | "authors": [ 1829 | { 1830 | "name": "Bernhard Schussek", 1831 | "email": "bschussek@gmail.com" 1832 | } 1833 | ], 1834 | "description": "Assertions to validate method input/output with nice error messages.", 1835 | "keywords": [ 1836 | "assert", 1837 | "check", 1838 | "validate" 1839 | ], 1840 | "support": { 1841 | "issues": "https://github.com/webmozarts/assert/issues", 1842 | "source": "https://github.com/webmozarts/assert/tree/1.10.0" 1843 | }, 1844 | "time": "2021-03-09T10:59:23+00:00" 1845 | } 1846 | ], 1847 | "aliases": [], 1848 | "minimum-stability": "dev", 1849 | "stability-flags": [], 1850 | "prefer-stable": true, 1851 | "prefer-lowest": false, 1852 | "platform": { 1853 | "php": ">=7.2" 1854 | }, 1855 | "platform-dev": [], 1856 | "plugin-api-version": "2.3.0" 1857 | } 1858 | -------------------------------------------------------------------------------- /phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | tests 9 | 10 | 11 | 12 | 13 | src 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /src/Builder.php: -------------------------------------------------------------------------------- 1 | query = $query; 24 | } 25 | 26 | /** 27 | * Set query parameter. 28 | * 29 | * @param string $key 30 | * @param mixed $value 31 | * 32 | * @return Builder 33 | */ 34 | public function where(string $key, $value) 35 | { 36 | $this->query[$key] = $value; 37 | 38 | return $this; 39 | } 40 | 41 | /** 42 | * Get the query array. 43 | * 44 | * @return array 45 | */ 46 | public function getParameters(): array 47 | { 48 | return $this->query; 49 | } 50 | 51 | /** 52 | * Get a specific paramater from the query. 53 | * 54 | * @param string $key 55 | * @param mixed $default 56 | * 57 | * @return mixed 58 | */ 59 | public function getParameter($key, $default = null) 60 | { 61 | return isset($this->query[$key]) ? $this->query[$key] : $default; 62 | } 63 | 64 | /** 65 | * Completes the query and returns a \WP_Query object. 66 | * 67 | * @return \WP_Query 68 | */ 69 | public function get(): WP_Query 70 | { 71 | return new WP_Query($this->getParameters()); 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /src/Concerns/BootsTraits.php: -------------------------------------------------------------------------------- 1 | getTraitNames(); 18 | 19 | // Loop over traits and call their bootable method. 20 | foreach ($traits as $trait) { 21 | // Create the bootable method string. 22 | $method = 'boot' . (new ReflectionClass($trait))->getShortName(); 23 | 24 | // Skip, if no bootable method available. 25 | if (!method_exists($this, $method)) { 26 | continue; 27 | } 28 | 29 | // Call the bootable method. 30 | $this->{$method}(); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/Concerns/HasScopes.php: -------------------------------------------------------------------------------- 1 | getShortName()); 60 | } 61 | 62 | /** 63 | * Setup scopes. 64 | * 65 | * @return void 66 | */ 67 | protected function buildScopes() 68 | { 69 | foreach (static::$scopes as $scope => $implementation) { 70 | $this->setupScope($scope, $implementation); 71 | } 72 | } 73 | 74 | /** 75 | * Setup each individual scope. 76 | * 77 | * @param string $scope 78 | * @param Query\Scope|\Closure $implementation 79 | * 80 | * @return void 81 | */ 82 | protected function setupScope(string $scope, $implementation) 83 | { 84 | if ($implementation instanceof Scope) { 85 | // Instantiate and add available scope. 86 | $this->available[$scope] = new $implementation; 87 | 88 | // Add scopes aliases. 89 | $aliases = $this->getScopeAliases($this->available[$scope]); 90 | 91 | foreach ($aliases as $alias) { 92 | $this->aliases[$alias] = $scope; 93 | } 94 | } else { 95 | $this->available[$scope] = $implementation; 96 | } 97 | } 98 | 99 | /** 100 | * Get the scopes aliases. 101 | * 102 | * @return array 103 | */ 104 | protected function getScopeAliases(Scope $scope): array 105 | { 106 | return empty($scope->aliases) ? [] : $scope->aliases; 107 | } 108 | 109 | /** 110 | * Returns array of all scopes including aliases. 111 | * 112 | * @return array 113 | */ 114 | protected function allScopes(): array 115 | { 116 | return array_merge(array_keys($this->available), array_keys($this->aliases)); 117 | } 118 | 119 | /** 120 | * Checks if a scope exists. 121 | * 122 | * @param string $scope 123 | * 124 | * @return boolean 125 | */ 126 | protected function hasScope(string $scope): bool 127 | { 128 | return (boolean) in_array($scope, $this->allScopes()); 129 | } 130 | 131 | /** 132 | * Calls the scope and passes arguments. 133 | * 134 | * @param string $scope 135 | * @param array $arguements 136 | * 137 | * @return Builder 138 | */ 139 | protected function callScope(string $scope, array $arguments = []): Builder 140 | { 141 | return call_user_func_array($this->resolveScope($scope), $arguments); 142 | } 143 | 144 | /** 145 | * Resolve the scope string to its instance. 146 | * 147 | * @param string $scope 148 | * 149 | * @return Scope 150 | */ 151 | protected function resolveScope(string $scope) 152 | { 153 | // Get correct scope for aliases. 154 | if (array_key_exists($scope, $this->aliases)) { 155 | $scope = $this->aliases[$scope]; 156 | } 157 | 158 | $callable = $this->available[$scope]; 159 | 160 | if ($callable instanceof Scope) { 161 | return [$callable, 'apply']; 162 | } 163 | 164 | return $callable; 165 | } 166 | } 167 | -------------------------------------------------------------------------------- /src/Concerns/QueriesPosts.php: -------------------------------------------------------------------------------- 1 | addScope($scope); 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/Query.php: -------------------------------------------------------------------------------- 1 | bootTraits(); 40 | 41 | // Build scopes. 42 | $this->buildScopes(); 43 | 44 | // Setup the Builder instances. 45 | $this->builder = $this->setup(new Builder($query)); 46 | } 47 | 48 | /** 49 | * Setup the intiial query. 50 | * 51 | * @param Builder $builder 52 | * 53 | * @return Builder 54 | */ 55 | public function setup(Builder $builder): Builder 56 | { 57 | return $builder; 58 | } 59 | 60 | /** 61 | * Get the query builder. 62 | * 63 | * @return Builder 64 | */ 65 | public function getBuilder() 66 | { 67 | return $this->builder; 68 | } 69 | 70 | /** 71 | * Handle dynamic static method calls. 72 | * 73 | * @param string $method 74 | * @param array $arguments 75 | * 76 | * @return mixed 77 | */ 78 | public static function __callStatic(string $method, array $arguments) 79 | { 80 | return (new static)->{$method}(...$arguments); 81 | } 82 | 83 | /** 84 | * Proxy dynamic method calls to the query builder and scopes. 85 | * 86 | * @param string $method 87 | * @param array $arguments 88 | * 89 | * @return mixed 90 | */ 91 | public function __call(string $method, array $arguments) 92 | { 93 | if ($this->hasScope($method)) { 94 | $this->builder = $this->callScope($method, array_merge([$this->builder], $arguments)); 95 | 96 | return $this; 97 | } 98 | 99 | $result = $this->builder->{$method}(...$arguments); 100 | 101 | if (in_array($method, $this->passThrough)) { 102 | return $result; 103 | } 104 | 105 | return $this; 106 | } 107 | } 108 | -------------------------------------------------------------------------------- /src/Scope.php: -------------------------------------------------------------------------------- 1 | where($key, $author); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/Scopes/AuthorIn.php: -------------------------------------------------------------------------------- 1 | where('author__in', $authors); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/Scopes/AuthorNotIn.php: -------------------------------------------------------------------------------- 1 | where('author__not_in', $authors); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/Scopes/Comments.php: -------------------------------------------------------------------------------- 1 | where('comment_count', $comments); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/Scopes/Meta.php: -------------------------------------------------------------------------------- 1 | getParameter('meta_query', []); 33 | 34 | if (is_array($key)) { 35 | $metaQuery[] = $key; 36 | 37 | return $builder->where('meta_query', $metaQuery); 38 | } 39 | 40 | $clause = []; 41 | 42 | $clause['key'] = $key; 43 | 44 | // If only key and compare were passed, assume compare is the value. 45 | if (3 === func_num_args()) { 46 | $clause['value'] = $compare; 47 | } else { 48 | $clause['value'] = $value; 49 | $clause['compare'] = $compare; 50 | 51 | if (!empty($type)) { 52 | $clause['type'] = $type; 53 | } 54 | } 55 | 56 | $metaQuery[] = $clause; 57 | 58 | return $builder->where('meta_query', $metaQuery); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /src/Scopes/Order.php: -------------------------------------------------------------------------------- 1 | where('order', $order); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/Scopes/OrderBy.php: -------------------------------------------------------------------------------- 1 | where('order_by', $key); 32 | } 33 | 34 | return $builder->where('order_by', $key)->where('order', $order); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/Scopes/Page.php: -------------------------------------------------------------------------------- 1 | where($key, $page); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/Scopes/ParentIn.php: -------------------------------------------------------------------------------- 1 | where('post_parent__in', $parents); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/Scopes/ParentNotIn.php: -------------------------------------------------------------------------------- 1 | where('post_parent__not_in', $parents); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/Scopes/Password.php: -------------------------------------------------------------------------------- 1 | where($key, $password); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/Scopes/Post.php: -------------------------------------------------------------------------------- 1 | where($key, $post); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/Scopes/PostIn.php: -------------------------------------------------------------------------------- 1 | where('post__in', $posts); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/Scopes/PostNotIn.php: -------------------------------------------------------------------------------- 1 | where('post__not_in', $posts); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/Scopes/PostParent.php: -------------------------------------------------------------------------------- 1 | where('post_parent', $parent); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/Scopes/PostStatus.php: -------------------------------------------------------------------------------- 1 | where('post_status', $status); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/Scopes/PostType.php: -------------------------------------------------------------------------------- 1 | where('post_type', $type); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/Scopes/PostsPerPage.php: -------------------------------------------------------------------------------- 1 | where('posts_per_page', $limit); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/Scopes/Search.php: -------------------------------------------------------------------------------- 1 | where('s', $search); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/Scopes/Taxonomy.php: -------------------------------------------------------------------------------- 1 | getParameter('tax_query', []); 35 | 36 | if (is_array($taxonomy)) { 37 | $taxQuery[] = $taxonomy; 38 | 39 | return $builder->where('tax_query', $taxQuery); 40 | } 41 | 42 | // Setup a new tax query clause array. 43 | $clause = []; 44 | 45 | // Setup the 46 | $clause['taxonomy'] = $taxonomy; 47 | $clause['terms'] = (array) $terms; 48 | 49 | // If terms are strings assume they are slugs. 50 | if (is_string($clause['terms'][0])) { 51 | $clause['field'] = 'slug'; 52 | } 53 | 54 | // Append the new tax query. 55 | $taxQuery[] = $clause; 56 | 57 | return $builder->where('tax_query', $taxQuery); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /tests/Unit/Query/BuilderTest.php: -------------------------------------------------------------------------------- 1 | assertInstanceOf(Builder::class, $builder); 13 | } 14 | 15 | public function test_builder_can_be_instantiated_with_query_array() 16 | { 17 | $builder = new Builder(['limit' => 10]); 18 | 19 | $this->assertInstanceOf(Builder::class, $builder); 20 | } 21 | 22 | public function test_builder_returns_correct_parameters() 23 | { 24 | $query = [ 25 | 'limit' => 10, 26 | ]; 27 | 28 | $builder = new Builder($query); 29 | 30 | $this->assertEquals($query, $builder->getParameters()); 31 | } 32 | 33 | public function test_builder_can_add_parameters_with_where_method() 34 | { 35 | $builder = new Builder(); 36 | 37 | $builder->where('post_type', 'post'); 38 | 39 | $this->assertEquals(['post_type' => 'post'], $builder->getParameters()); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /tests/Unit/Query/Concerns/HasScopesTest.php: -------------------------------------------------------------------------------- 1 | post_type('event')->getParameters(); 13 | 14 | $this->assertEquals(['s' => 'test', 'post_type' => 'event'], $result); 15 | } 16 | 17 | public function test_query_can_add_scopes_with_scope_class() 18 | { 19 | Query::addScope(new \Query\Tests\Unit\Query\Stubs\TestScope); 20 | 21 | $result = Query::test(true)->getParameters(); 22 | 23 | $this->assertEquals(['test' => true], $result); 24 | } 25 | 26 | public function test_query_can_add_scopes_with_closure() 27 | { 28 | Query::addScope('test', function (Builder $builder, $var) { 29 | return $builder->where('test', $var); 30 | }); 31 | 32 | $result = Query::test(true)->getParameters(); 33 | 34 | $this->assertEquals(['test' => true], $result); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /tests/Unit/Query/QueryTest.php: -------------------------------------------------------------------------------- 1 | assertInstanceOf(Query::class, $query); 14 | } 15 | 16 | public function test_query_can_be_instantiated_with_query_array() 17 | { 18 | $query = new Query(['limit' => 10]); 19 | 20 | $this->assertInstanceOf(Query::class, $query); 21 | } 22 | 23 | public function test_query_can_be_instantiated_with_static_call() 24 | { 25 | $query = Query::where('limit', 10); 26 | 27 | $this->assertInstanceOf(Query::class, $query); 28 | } 29 | 30 | public function test_query_can_proxy_methods_to_builder() 31 | { 32 | $query = Query::where('limit', 10); 33 | 34 | $this->assertEquals(['limit' => 10], $query->getParameters()); 35 | } 36 | 37 | public function test_query_can_chain_and_proxy_methods_to_builder() 38 | { 39 | $query = Query::where('limit', 10)->where('post_type', 'post')->where('fields', 'ids'); 40 | 41 | $expected = [ 42 | 'limit' => 10, 43 | 'post_type' => 'post', 44 | 'fields' => 'ids', 45 | ]; 46 | 47 | $this->assertEquals($expected, $query->getParameters()); 48 | } 49 | 50 | public function test_query_can_be_passed_through_via_builder_methods() 51 | { 52 | $parameters = Query::where('limit', 10)->getParameters(); 53 | 54 | $this->assertNotInstanceOf(Query::class, $parameters); 55 | $this->assertEquals(['limit' => 10], $parameters); 56 | } 57 | 58 | public function test_query_can_return_builder() 59 | { 60 | $builder = Query::where('limit', 10)->getBuilder(); 61 | 62 | $this->assertInstanceOf(Builder::class, $builder); 63 | $this->assertEquals(['limit' => 10], $builder->getParameters()); 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /tests/Unit/Query/Scopes/AuthorInTest.php: -------------------------------------------------------------------------------- 1 | apply(new Builder(), [1, 2, 3]); 12 | 13 | $this->assertEquals(['author__in' => [1, 2, 3]], $builder->getParameters()); 14 | } 15 | 16 | public function test_scope_returns_builder() 17 | { 18 | $builder = (new AuthorIn())->apply(new Builder(), [1, 2, 3]); 19 | 20 | $this->assertInstanceOf(Builder::class, $builder); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /tests/Unit/Query/Scopes/AuthorNotInTest.php: -------------------------------------------------------------------------------- 1 | apply(new Builder(), [1, 2, 3]); 12 | 13 | $this->assertEquals(['author__not_in' => [1, 2, 3]], $builder->getParameters()); 14 | } 15 | 16 | public function test_scope_returns_builder() 17 | { 18 | $builder = (new AuthorNotIn())->apply(new Builder(), [1, 2, 3]); 19 | 20 | $this->assertInstanceOf(Builder::class, $builder); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /tests/Unit/Query/Scopes/AuthorTest.php: -------------------------------------------------------------------------------- 1 | apply(new Builder(), 1); 12 | 13 | $this->assertEquals(['author' => 1], $builder->getParameters()); 14 | } 15 | 16 | public function test_scope_applies_parameters_correctly_with_string() 17 | { 18 | $builder = (new Author())->apply(new Builder(), 'admin'); 19 | 20 | $this->assertEquals(['author_name' => 'admin'], $builder->getParameters()); 21 | } 22 | 23 | public function test_scope_applies_parameters_correctly_with_comma_separated_string() 24 | { 25 | $builder = (new Author())->apply(new Builder(), '1,2,3'); 26 | 27 | $this->assertEquals(['author' => '1,2,3'], $builder->getParameters()); 28 | } 29 | 30 | public function test_scope_returns_builder() 31 | { 32 | $builder = (new Author())->apply(new Builder(), 1); 33 | 34 | $this->assertInstanceOf(Builder::class, $builder); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /tests/Unit/Query/Scopes/CommentsTest.php: -------------------------------------------------------------------------------- 1 | apply(new Builder(), 10); 12 | 13 | $this->assertEquals(['comment_count' => 10], $builder->getParameters()); 14 | } 15 | 16 | public function test_scope_returns_builder() 17 | { 18 | $builder = (new Comments())->apply(new Builder(), 10); 19 | 20 | $this->assertInstanceOf(Builder::class, $builder); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /tests/Unit/Query/Scopes/MetaTest.php: -------------------------------------------------------------------------------- 1 | apply(new Builder(), 'price', '>', 1000, 'NUMERIC'); 12 | 13 | $expected = [ 14 | [ 15 | 'key' => 'price', 16 | 'value' => 1000, 17 | 'compare' => '>', 18 | 'type' => 'NUMERIC', 19 | ] 20 | ]; 21 | 22 | $this->assertEquals($expected, $builder->getParameter('meta_query')); 23 | } 24 | 25 | public function test_scope_returns_builder() 26 | { 27 | $builder = (new Meta())->apply(new Builder(), 'Meta term'); 28 | 29 | $this->assertInstanceOf(Builder::class, $builder); 30 | } 31 | 32 | public function test_scope_accepts_key_value_pair() 33 | { 34 | $builder = (new Meta())->apply(new Builder(), 'price', 1000); 35 | 36 | $expected = [ 37 | [ 38 | 'key' => 'price', 39 | 'value' => 1000, 40 | ] 41 | ]; 42 | 43 | $this->assertEquals($expected, $builder->getParameter('meta_query')); 44 | } 45 | 46 | public function test_scope_accepts_an_array() 47 | { 48 | $builder = (new Meta())->apply(new Builder(), [ 49 | 'key' => 'price', 50 | 'value' => 1000, 51 | 'compare' => '>', 52 | 'type' => 'NUMERIC' 53 | ]); 54 | 55 | $expected = [ 56 | [ 57 | 'key' => 'price', 58 | 'value' => 1000, 59 | 'compare' => '>', 60 | 'type' => 'NUMERIC', 61 | ] 62 | ]; 63 | 64 | $this->assertEquals($expected, $builder->getParameter('meta_query')); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /tests/Unit/Query/Scopes/OrderByTest.php: -------------------------------------------------------------------------------- 1 | apply(new Builder(), 'date'); 12 | 13 | $this->assertEquals(['order_by' => 'date', 'order' => 'DESC'], $builder->getParameters()); 14 | } 15 | 16 | public function test_scope_applies_parameters_correctly_with_array() 17 | { 18 | $builder = (new OrderBy())->apply(new Builder(), ['title' => 'DESC', 'menu_order' => 'ASC']); 19 | 20 | $expected = [ 21 | 'order_by' => [ 22 | 'title' => 'DESC', 23 | 'menu_order' => 'ASC', 24 | ], 25 | ]; 26 | 27 | $this->assertEquals($expected, $builder->getParameters()); 28 | } 29 | 30 | public function test_scope_returns_builder() 31 | { 32 | $builder = (new OrderBy())->apply(new Builder(), 10); 33 | 34 | $this->assertInstanceOf(Builder::class, $builder); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /tests/Unit/Query/Scopes/OrderTest.php: -------------------------------------------------------------------------------- 1 | apply(new Builder(), 'ASC'); 12 | 13 | $this->assertEquals(['order' => 'ASC'], $builder->getParameters()); 14 | } 15 | 16 | public function test_scope_returns_builder() 17 | { 18 | $builder = (new Order())->apply(new Builder(), 10); 19 | 20 | $this->assertInstanceOf(Builder::class, $builder); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /tests/Unit/Query/Scopes/PageTest.php: -------------------------------------------------------------------------------- 1 | apply(new Builder(), 1); 12 | 13 | $this->assertEquals(['page_id' => 1], $builder->getParameters()); 14 | } 15 | 16 | public function test_scope_applies_parameters_correctly_with_string() 17 | { 18 | $builder = (new Page())->apply(new Builder(), 'hello-world'); 19 | 20 | $this->assertEquals(['pagename' => 'hello-world'], $builder->getParameters()); 21 | } 22 | 23 | public function test_scope_returns_builder() 24 | { 25 | $builder = (new Page())->apply(new Builder(), 1); 26 | 27 | $this->assertInstanceOf(Builder::class, $builder); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /tests/Unit/Query/Scopes/ParentInTest.php: -------------------------------------------------------------------------------- 1 | apply(new Builder(), [1, 2, 3]); 12 | 13 | $this->assertEquals(['post_parent__in' => [1, 2, 3]], $builder->getParameters()); 14 | } 15 | 16 | public function test_scope_returns_builder() 17 | { 18 | $builder = (new ParentIn())->apply(new Builder(), [1, 2, 3]); 19 | 20 | $this->assertInstanceOf(Builder::class, $builder); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /tests/Unit/Query/Scopes/ParentNotInTest.php: -------------------------------------------------------------------------------- 1 | apply(new Builder(), [1, 2, 3]); 12 | 13 | $this->assertEquals(['post_parent__not_in' => [1, 2, 3]], $builder->getParameters()); 14 | } 15 | 16 | public function test_scope_returns_builder() 17 | { 18 | $builder = (new ParentNotIn())->apply(new Builder(), [1, 2, 3]); 19 | 20 | $this->assertInstanceOf(Builder::class, $builder); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /tests/Unit/Query/Scopes/PasswordTest.php: -------------------------------------------------------------------------------- 1 | apply(new Builder(), true)->getParameters(); 14 | $false = $passwordScope->apply(new Builder(), false)->getParameters(); 15 | $password = $passwordScope->apply(new Builder(), 'secret')->getParameters(); 16 | 17 | $this->assertEquals(['has_password' => true], $true); 18 | $this->assertEquals(['has_password' => false], $false); 19 | $this->assertEquals(['post_password' => 'secret'], $password); 20 | } 21 | 22 | public function test_scope_returns_builder() 23 | { 24 | $builder = (new Password())->apply(new Builder(), 10); 25 | 26 | $this->assertInstanceOf(Builder::class, $builder); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /tests/Unit/Query/Scopes/PostInTest.php: -------------------------------------------------------------------------------- 1 | apply(new Builder(), [1, 2, 3]); 12 | 13 | $this->assertEquals(['post__in' => [1, 2, 3]], $builder->getParameters()); 14 | } 15 | 16 | public function test_scope_returns_builder() 17 | { 18 | $builder = (new PostIn())->apply(new Builder(), [1, 2, 3]); 19 | 20 | $this->assertInstanceOf(Builder::class, $builder); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /tests/Unit/Query/Scopes/PostNotInTest.php: -------------------------------------------------------------------------------- 1 | apply(new Builder(), [1, 2, 3]); 12 | 13 | $this->assertEquals(['post__not_in' => [1, 2, 3]], $builder->getParameters()); 14 | } 15 | 16 | public function test_scope_returns_builder() 17 | { 18 | $builder = (new PostNotIn())->apply(new Builder(), [1, 2, 3]); 19 | 20 | $this->assertInstanceOf(Builder::class, $builder); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /tests/Unit/Query/Scopes/PostParentTest.php: -------------------------------------------------------------------------------- 1 | apply(new Builder(), 1); 12 | 13 | $this->assertEquals(['post_parent' => 1], $builder->getParameters()); 14 | } 15 | 16 | public function test_scope_returns_builder() 17 | { 18 | $builder = (new PostParent())->apply(new Builder(), 1); 19 | 20 | $this->assertInstanceOf(Builder::class, $builder); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /tests/Unit/Query/Scopes/PostStatusTest.php: -------------------------------------------------------------------------------- 1 | apply(new Builder(), 'publish'); 12 | 13 | $this->assertEquals(['post_status' => 'publish'], $builder->getParameters()); 14 | } 15 | 16 | public function test_scope_returns_builder() 17 | { 18 | $builder = (new PostStatus())->apply(new Builder(), 'publish'); 19 | 20 | $this->assertInstanceOf(Builder::class, $builder); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /tests/Unit/Query/Scopes/PostTest.php: -------------------------------------------------------------------------------- 1 | apply(new Builder(), 1); 12 | 13 | $this->assertEquals(['p' => 1], $builder->getParameters()); 14 | } 15 | 16 | public function test_scope_applies_parameters_correctly_with_string() 17 | { 18 | $builder = (new Post())->apply(new Builder(), 'hello-world'); 19 | 20 | $this->assertEquals(['name' => 'hello-world'], $builder->getParameters()); 21 | } 22 | 23 | public function test_scope_returns_builder() 24 | { 25 | $builder = (new Post())->apply(new Builder(), 1); 26 | 27 | $this->assertInstanceOf(Builder::class, $builder); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /tests/Unit/Query/Scopes/PostTypeTest.php: -------------------------------------------------------------------------------- 1 | apply(new Builder(), 'post'); 12 | 13 | $this->assertEquals(['post_type' => 'post'], $builder->getParameters()); 14 | } 15 | 16 | public function test_scope_returns_builder() 17 | { 18 | $builder = (new PostType())->apply(new Builder(), 'post'); 19 | 20 | $this->assertInstanceOf(Builder::class, $builder); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /tests/Unit/Query/Scopes/PostsPerPageTest.php: -------------------------------------------------------------------------------- 1 | apply(new Builder(), 10); 12 | 13 | $this->assertEquals(['posts_per_page' => 10], $builder->getParameters()); 14 | } 15 | 16 | public function test_scope_returns_builder() 17 | { 18 | $builder = (new PostsPerPage())->apply(new Builder(), 10); 19 | 20 | $this->assertInstanceOf(Builder::class, $builder); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /tests/Unit/Query/Scopes/SearchTest.php: -------------------------------------------------------------------------------- 1 | apply(new Builder(), 'search term'); 12 | 13 | $this->assertEquals(['s' => 'search term'], $builder->getParameters()); 14 | } 15 | 16 | public function test_scope_returns_builder() 17 | { 18 | $builder = (new Search())->apply(new Builder(), 'search term'); 19 | 20 | $this->assertInstanceOf(Builder::class, $builder); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /tests/Unit/Query/Scopes/TaxonomyTest.php: -------------------------------------------------------------------------------- 1 | apply(new Builder(), 'category', 1); 12 | 13 | $expected = [ 14 | [ 15 | 'taxonomy' => 'category', 16 | 'terms' => [ 1 ], 17 | ] 18 | ]; 19 | 20 | $this->assertEquals($expected, $builder->getParameter('tax_query')); 21 | } 22 | 23 | public function test_scope_returns_builder() 24 | { 25 | $builder = (new Taxonomy())->apply(new Builder(), 'category', 1); 26 | 27 | $this->assertInstanceOf(Builder::class, $builder); 28 | } 29 | 30 | public function test_scope_uses_slugs_when_terms_are_string() 31 | { 32 | $builder = (new Taxonomy())->apply(new Builder(), 'category', 'news'); 33 | 34 | $expected = [ 35 | [ 36 | 'taxonomy' => 'category', 37 | 'terms' => [ 'news' ], 38 | 'field' => 'slug', 39 | ] 40 | ]; 41 | 42 | $this->assertEquals($expected, $builder->getParameter('tax_query')); 43 | } 44 | 45 | public function test_scope_accepts_array() 46 | { 47 | $builder = (new Taxonomy())->apply(new Builder(), [ 48 | 'taxonomy' => 'category', 49 | 'terms' => [ 'news' ], 50 | 'field' => 'slug', 51 | 'operator' => 'NOT IN', 52 | 'include_children' => false 53 | ]); 54 | 55 | $expected = [ 56 | [ 57 | 'taxonomy' => 'category', 58 | 'terms' => [ 'news' ], 59 | 'field' => 'slug', 60 | 'operator' => 'NOT IN', 61 | 'include_children' => false 62 | ] 63 | ]; 64 | 65 | $this->assertEquals($expected, $builder->getParameter('tax_query')); 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /tests/Unit/Query/Stubs/TestScope.php: -------------------------------------------------------------------------------- 1 | where('test', $value); 17 | } 18 | } 19 | --------------------------------------------------------------------------------