├── .gitignore ├── LICENCE.md ├── README.md ├── composer.json ├── composer.lock ├── guide.md ├── phpunit.xml ├── public └── example.php ├── src └── Example │ └── Greeting.php └── tests └── Example └── GreetingTest.php /.gitignore: -------------------------------------------------------------------------------- 1 | composer.phar 2 | /vendor/ 3 | /.idea/ 4 | .phpunit.result.cache 5 | -------------------------------------------------------------------------------- /LICENCE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2025 Elliot J. Reed 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # PHP Package Boilerplate / Example Project 2 | 3 | This repository shows a basic setup for a PHP package or application in PHP. 4 | 5 | ## PHP Versions 6 | 7 | This version will work on PHP version 8.2 and above. 8 | 9 | For a version which is compatible with PHP 8.0 and 8.1 select the 8.0 Git tag ([github.com/elliotjreed/php-package-boilerplate/tree/8.0](https://github.com/elliotjreed/php-package-boilerplate/tree/8.0)). 10 | 11 | For a version which is compatible with PHP 7.4 select the 7.4 Git tag ([github.com/elliotjreed/php-package-boilerplate/tree/7.4](https://github.com/elliotjreed/php-package-boilerplate/tree/7.4)). 12 | 13 | ## Getting Started 14 | 15 | PHP 8.2 or above and Composer is expected to be installed on our system. 16 | 17 | ### Installing Composer 18 | 19 | For instructions on how to install Composer visit [getcomposer.org](https://getcomposer.org/download/). 20 | 21 | ### Installing 22 | 23 | After cloning this repository, change into the newly created directory and run 24 | 25 | ```bash 26 | composer install 27 | ``` 28 | 29 | or if you have installed Composer locally in your current directory 30 | 31 | ```bash 32 | php composer.phar install 33 | ``` 34 | 35 | This will install all dependencies needed for the project. 36 | 37 | ## Running the Tests 38 | 39 | All tests can be run by executing 40 | 41 | ```bash 42 | vendor/bin/phpunit 43 | ``` 44 | 45 | `phpunit` will automatically find all tests inside the `test` directory and run them based on the configuration in the `phpunit.xml` file. 46 | 47 | ### Testing Approach 48 | 49 | The test for the class `Greeting` verifies that the return value of the `sayHello` method returns the string "Hello {name}", where {name} is the value passed through to the constructor. 50 | 51 | ## Running the Application 52 | 53 | PHP has an in-built server for local development. This can be started by executing 54 | 55 | ``` 56 | php -S localhost:8000 -t public 57 | ``` 58 | 59 | Then open your browser at `http://localhost:8000/example.php` 60 | 61 | You should see the text "Hello Ada Lovelace" on your screen. 62 | 63 | ## Built With 64 | 65 | - [PHP](https://secure.php.net/) 66 | - [Composer](https://getcomposer.org/) 67 | - [PHPUnit](https://phpunit.de/) 68 | 69 | ## License 70 | 71 | This project is licensed under the MIT License - see the [LICENCE.md](LICENCE.md) file for details. 72 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "elliotjreed/php-package-boilperplate", 3 | "license": "MIT", 4 | "type": "project", 5 | "description": "Example PHP package.", 6 | "autoload": { 7 | "psr-4" : { 8 | "Example\\" : "src/Example/" 9 | } 10 | }, 11 | "autoload-dev": { 12 | "psr-4" : { 13 | "Tests\\Example\\" : "tests/Example/" 14 | } 15 | }, 16 | "require": { 17 | "php": "^8.1" 18 | }, 19 | "require-dev": { 20 | "phpunit/phpunit": "^10.5" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /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": "c06f3c1c271dc443508417c960af7ec6", 8 | "packages": [], 9 | "packages-dev": [ 10 | { 11 | "name": "myclabs/deep-copy", 12 | "version": "1.12.1", 13 | "source": { 14 | "type": "git", 15 | "url": "https://github.com/myclabs/DeepCopy.git", 16 | "reference": "123267b2c49fbf30d78a7b2d333f6be754b94845" 17 | }, 18 | "dist": { 19 | "type": "zip", 20 | "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/123267b2c49fbf30d78a7b2d333f6be754b94845", 21 | "reference": "123267b2c49fbf30d78a7b2d333f6be754b94845", 22 | "shasum": "" 23 | }, 24 | "require": { 25 | "php": "^7.1 || ^8.0" 26 | }, 27 | "conflict": { 28 | "doctrine/collections": "<1.6.8", 29 | "doctrine/common": "<2.13.3 || >=3 <3.2.2" 30 | }, 31 | "require-dev": { 32 | "doctrine/collections": "^1.6.8", 33 | "doctrine/common": "^2.13.3 || ^3.2.2", 34 | "phpspec/prophecy": "^1.10", 35 | "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" 36 | }, 37 | "type": "library", 38 | "autoload": { 39 | "files": [ 40 | "src/DeepCopy/deep_copy.php" 41 | ], 42 | "psr-4": { 43 | "DeepCopy\\": "src/DeepCopy/" 44 | } 45 | }, 46 | "notification-url": "https://packagist.org/downloads/", 47 | "license": [ 48 | "MIT" 49 | ], 50 | "description": "Create deep copies (clones) of your objects", 51 | "keywords": [ 52 | "clone", 53 | "copy", 54 | "duplicate", 55 | "object", 56 | "object graph" 57 | ], 58 | "support": { 59 | "issues": "https://github.com/myclabs/DeepCopy/issues", 60 | "source": "https://github.com/myclabs/DeepCopy/tree/1.12.1" 61 | }, 62 | "funding": [ 63 | { 64 | "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", 65 | "type": "tidelift" 66 | } 67 | ], 68 | "time": "2024-11-08T17:47:46+00:00" 69 | }, 70 | { 71 | "name": "nikic/php-parser", 72 | "version": "v5.3.1", 73 | "source": { 74 | "type": "git", 75 | "url": "https://github.com/nikic/PHP-Parser.git", 76 | "reference": "8eea230464783aa9671db8eea6f8c6ac5285794b" 77 | }, 78 | "dist": { 79 | "type": "zip", 80 | "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/8eea230464783aa9671db8eea6f8c6ac5285794b", 81 | "reference": "8eea230464783aa9671db8eea6f8c6ac5285794b", 82 | "shasum": "" 83 | }, 84 | "require": { 85 | "ext-ctype": "*", 86 | "ext-json": "*", 87 | "ext-tokenizer": "*", 88 | "php": ">=7.4" 89 | }, 90 | "require-dev": { 91 | "ircmaxell/php-yacc": "^0.0.7", 92 | "phpunit/phpunit": "^9.0" 93 | }, 94 | "bin": [ 95 | "bin/php-parse" 96 | ], 97 | "type": "library", 98 | "extra": { 99 | "branch-alias": { 100 | "dev-master": "5.0-dev" 101 | } 102 | }, 103 | "autoload": { 104 | "psr-4": { 105 | "PhpParser\\": "lib/PhpParser" 106 | } 107 | }, 108 | "notification-url": "https://packagist.org/downloads/", 109 | "license": [ 110 | "BSD-3-Clause" 111 | ], 112 | "authors": [ 113 | { 114 | "name": "Nikita Popov" 115 | } 116 | ], 117 | "description": "A PHP parser written in PHP", 118 | "keywords": [ 119 | "parser", 120 | "php" 121 | ], 122 | "support": { 123 | "issues": "https://github.com/nikic/PHP-Parser/issues", 124 | "source": "https://github.com/nikic/PHP-Parser/tree/v5.3.1" 125 | }, 126 | "time": "2024-10-08T18:51:32+00:00" 127 | }, 128 | { 129 | "name": "phar-io/manifest", 130 | "version": "2.0.4", 131 | "source": { 132 | "type": "git", 133 | "url": "https://github.com/phar-io/manifest.git", 134 | "reference": "54750ef60c58e43759730615a392c31c80e23176" 135 | }, 136 | "dist": { 137 | "type": "zip", 138 | "url": "https://api.github.com/repos/phar-io/manifest/zipball/54750ef60c58e43759730615a392c31c80e23176", 139 | "reference": "54750ef60c58e43759730615a392c31c80e23176", 140 | "shasum": "" 141 | }, 142 | "require": { 143 | "ext-dom": "*", 144 | "ext-libxml": "*", 145 | "ext-phar": "*", 146 | "ext-xmlwriter": "*", 147 | "phar-io/version": "^3.0.1", 148 | "php": "^7.2 || ^8.0" 149 | }, 150 | "type": "library", 151 | "extra": { 152 | "branch-alias": { 153 | "dev-master": "2.0.x-dev" 154 | } 155 | }, 156 | "autoload": { 157 | "classmap": [ 158 | "src/" 159 | ] 160 | }, 161 | "notification-url": "https://packagist.org/downloads/", 162 | "license": [ 163 | "BSD-3-Clause" 164 | ], 165 | "authors": [ 166 | { 167 | "name": "Arne Blankerts", 168 | "email": "arne@blankerts.de", 169 | "role": "Developer" 170 | }, 171 | { 172 | "name": "Sebastian Heuer", 173 | "email": "sebastian@phpeople.de", 174 | "role": "Developer" 175 | }, 176 | { 177 | "name": "Sebastian Bergmann", 178 | "email": "sebastian@phpunit.de", 179 | "role": "Developer" 180 | } 181 | ], 182 | "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", 183 | "support": { 184 | "issues": "https://github.com/phar-io/manifest/issues", 185 | "source": "https://github.com/phar-io/manifest/tree/2.0.4" 186 | }, 187 | "funding": [ 188 | { 189 | "url": "https://github.com/theseer", 190 | "type": "github" 191 | } 192 | ], 193 | "time": "2024-03-03T12:33:53+00:00" 194 | }, 195 | { 196 | "name": "phar-io/version", 197 | "version": "3.2.1", 198 | "source": { 199 | "type": "git", 200 | "url": "https://github.com/phar-io/version.git", 201 | "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74" 202 | }, 203 | "dist": { 204 | "type": "zip", 205 | "url": "https://api.github.com/repos/phar-io/version/zipball/4f7fd7836c6f332bb2933569e566a0d6c4cbed74", 206 | "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74", 207 | "shasum": "" 208 | }, 209 | "require": { 210 | "php": "^7.2 || ^8.0" 211 | }, 212 | "type": "library", 213 | "autoload": { 214 | "classmap": [ 215 | "src/" 216 | ] 217 | }, 218 | "notification-url": "https://packagist.org/downloads/", 219 | "license": [ 220 | "BSD-3-Clause" 221 | ], 222 | "authors": [ 223 | { 224 | "name": "Arne Blankerts", 225 | "email": "arne@blankerts.de", 226 | "role": "Developer" 227 | }, 228 | { 229 | "name": "Sebastian Heuer", 230 | "email": "sebastian@phpeople.de", 231 | "role": "Developer" 232 | }, 233 | { 234 | "name": "Sebastian Bergmann", 235 | "email": "sebastian@phpunit.de", 236 | "role": "Developer" 237 | } 238 | ], 239 | "description": "Library for handling version information and constraints", 240 | "support": { 241 | "issues": "https://github.com/phar-io/version/issues", 242 | "source": "https://github.com/phar-io/version/tree/3.2.1" 243 | }, 244 | "time": "2022-02-21T01:04:05+00:00" 245 | }, 246 | { 247 | "name": "phpunit/php-code-coverage", 248 | "version": "10.1.16", 249 | "source": { 250 | "type": "git", 251 | "url": "https://github.com/sebastianbergmann/php-code-coverage.git", 252 | "reference": "7e308268858ed6baedc8704a304727d20bc07c77" 253 | }, 254 | "dist": { 255 | "type": "zip", 256 | "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/7e308268858ed6baedc8704a304727d20bc07c77", 257 | "reference": "7e308268858ed6baedc8704a304727d20bc07c77", 258 | "shasum": "" 259 | }, 260 | "require": { 261 | "ext-dom": "*", 262 | "ext-libxml": "*", 263 | "ext-xmlwriter": "*", 264 | "nikic/php-parser": "^4.19.1 || ^5.1.0", 265 | "php": ">=8.1", 266 | "phpunit/php-file-iterator": "^4.1.0", 267 | "phpunit/php-text-template": "^3.0.1", 268 | "sebastian/code-unit-reverse-lookup": "^3.0.0", 269 | "sebastian/complexity": "^3.2.0", 270 | "sebastian/environment": "^6.1.0", 271 | "sebastian/lines-of-code": "^2.0.2", 272 | "sebastian/version": "^4.0.1", 273 | "theseer/tokenizer": "^1.2.3" 274 | }, 275 | "require-dev": { 276 | "phpunit/phpunit": "^10.1" 277 | }, 278 | "suggest": { 279 | "ext-pcov": "PHP extension that provides line coverage", 280 | "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" 281 | }, 282 | "type": "library", 283 | "extra": { 284 | "branch-alias": { 285 | "dev-main": "10.1.x-dev" 286 | } 287 | }, 288 | "autoload": { 289 | "classmap": [ 290 | "src/" 291 | ] 292 | }, 293 | "notification-url": "https://packagist.org/downloads/", 294 | "license": [ 295 | "BSD-3-Clause" 296 | ], 297 | "authors": [ 298 | { 299 | "name": "Sebastian Bergmann", 300 | "email": "sebastian@phpunit.de", 301 | "role": "lead" 302 | } 303 | ], 304 | "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", 305 | "homepage": "https://github.com/sebastianbergmann/php-code-coverage", 306 | "keywords": [ 307 | "coverage", 308 | "testing", 309 | "xunit" 310 | ], 311 | "support": { 312 | "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", 313 | "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", 314 | "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/10.1.16" 315 | }, 316 | "funding": [ 317 | { 318 | "url": "https://github.com/sebastianbergmann", 319 | "type": "github" 320 | } 321 | ], 322 | "time": "2024-08-22T04:31:57+00:00" 323 | }, 324 | { 325 | "name": "phpunit/php-file-iterator", 326 | "version": "4.1.0", 327 | "source": { 328 | "type": "git", 329 | "url": "https://github.com/sebastianbergmann/php-file-iterator.git", 330 | "reference": "a95037b6d9e608ba092da1b23931e537cadc3c3c" 331 | }, 332 | "dist": { 333 | "type": "zip", 334 | "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/a95037b6d9e608ba092da1b23931e537cadc3c3c", 335 | "reference": "a95037b6d9e608ba092da1b23931e537cadc3c3c", 336 | "shasum": "" 337 | }, 338 | "require": { 339 | "php": ">=8.1" 340 | }, 341 | "require-dev": { 342 | "phpunit/phpunit": "^10.0" 343 | }, 344 | "type": "library", 345 | "extra": { 346 | "branch-alias": { 347 | "dev-main": "4.0-dev" 348 | } 349 | }, 350 | "autoload": { 351 | "classmap": [ 352 | "src/" 353 | ] 354 | }, 355 | "notification-url": "https://packagist.org/downloads/", 356 | "license": [ 357 | "BSD-3-Clause" 358 | ], 359 | "authors": [ 360 | { 361 | "name": "Sebastian Bergmann", 362 | "email": "sebastian@phpunit.de", 363 | "role": "lead" 364 | } 365 | ], 366 | "description": "FilterIterator implementation that filters files based on a list of suffixes.", 367 | "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", 368 | "keywords": [ 369 | "filesystem", 370 | "iterator" 371 | ], 372 | "support": { 373 | "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", 374 | "security": "https://github.com/sebastianbergmann/php-file-iterator/security/policy", 375 | "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/4.1.0" 376 | }, 377 | "funding": [ 378 | { 379 | "url": "https://github.com/sebastianbergmann", 380 | "type": "github" 381 | } 382 | ], 383 | "time": "2023-08-31T06:24:48+00:00" 384 | }, 385 | { 386 | "name": "phpunit/php-invoker", 387 | "version": "4.0.0", 388 | "source": { 389 | "type": "git", 390 | "url": "https://github.com/sebastianbergmann/php-invoker.git", 391 | "reference": "f5e568ba02fa5ba0ddd0f618391d5a9ea50b06d7" 392 | }, 393 | "dist": { 394 | "type": "zip", 395 | "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/f5e568ba02fa5ba0ddd0f618391d5a9ea50b06d7", 396 | "reference": "f5e568ba02fa5ba0ddd0f618391d5a9ea50b06d7", 397 | "shasum": "" 398 | }, 399 | "require": { 400 | "php": ">=8.1" 401 | }, 402 | "require-dev": { 403 | "ext-pcntl": "*", 404 | "phpunit/phpunit": "^10.0" 405 | }, 406 | "suggest": { 407 | "ext-pcntl": "*" 408 | }, 409 | "type": "library", 410 | "extra": { 411 | "branch-alias": { 412 | "dev-main": "4.0-dev" 413 | } 414 | }, 415 | "autoload": { 416 | "classmap": [ 417 | "src/" 418 | ] 419 | }, 420 | "notification-url": "https://packagist.org/downloads/", 421 | "license": [ 422 | "BSD-3-Clause" 423 | ], 424 | "authors": [ 425 | { 426 | "name": "Sebastian Bergmann", 427 | "email": "sebastian@phpunit.de", 428 | "role": "lead" 429 | } 430 | ], 431 | "description": "Invoke callables with a timeout", 432 | "homepage": "https://github.com/sebastianbergmann/php-invoker/", 433 | "keywords": [ 434 | "process" 435 | ], 436 | "support": { 437 | "issues": "https://github.com/sebastianbergmann/php-invoker/issues", 438 | "source": "https://github.com/sebastianbergmann/php-invoker/tree/4.0.0" 439 | }, 440 | "funding": [ 441 | { 442 | "url": "https://github.com/sebastianbergmann", 443 | "type": "github" 444 | } 445 | ], 446 | "time": "2023-02-03T06:56:09+00:00" 447 | }, 448 | { 449 | "name": "phpunit/php-text-template", 450 | "version": "3.0.1", 451 | "source": { 452 | "type": "git", 453 | "url": "https://github.com/sebastianbergmann/php-text-template.git", 454 | "reference": "0c7b06ff49e3d5072f057eb1fa59258bf287a748" 455 | }, 456 | "dist": { 457 | "type": "zip", 458 | "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/0c7b06ff49e3d5072f057eb1fa59258bf287a748", 459 | "reference": "0c7b06ff49e3d5072f057eb1fa59258bf287a748", 460 | "shasum": "" 461 | }, 462 | "require": { 463 | "php": ">=8.1" 464 | }, 465 | "require-dev": { 466 | "phpunit/phpunit": "^10.0" 467 | }, 468 | "type": "library", 469 | "extra": { 470 | "branch-alias": { 471 | "dev-main": "3.0-dev" 472 | } 473 | }, 474 | "autoload": { 475 | "classmap": [ 476 | "src/" 477 | ] 478 | }, 479 | "notification-url": "https://packagist.org/downloads/", 480 | "license": [ 481 | "BSD-3-Clause" 482 | ], 483 | "authors": [ 484 | { 485 | "name": "Sebastian Bergmann", 486 | "email": "sebastian@phpunit.de", 487 | "role": "lead" 488 | } 489 | ], 490 | "description": "Simple template engine.", 491 | "homepage": "https://github.com/sebastianbergmann/php-text-template/", 492 | "keywords": [ 493 | "template" 494 | ], 495 | "support": { 496 | "issues": "https://github.com/sebastianbergmann/php-text-template/issues", 497 | "security": "https://github.com/sebastianbergmann/php-text-template/security/policy", 498 | "source": "https://github.com/sebastianbergmann/php-text-template/tree/3.0.1" 499 | }, 500 | "funding": [ 501 | { 502 | "url": "https://github.com/sebastianbergmann", 503 | "type": "github" 504 | } 505 | ], 506 | "time": "2023-08-31T14:07:24+00:00" 507 | }, 508 | { 509 | "name": "phpunit/php-timer", 510 | "version": "6.0.0", 511 | "source": { 512 | "type": "git", 513 | "url": "https://github.com/sebastianbergmann/php-timer.git", 514 | "reference": "e2a2d67966e740530f4a3343fe2e030ffdc1161d" 515 | }, 516 | "dist": { 517 | "type": "zip", 518 | "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/e2a2d67966e740530f4a3343fe2e030ffdc1161d", 519 | "reference": "e2a2d67966e740530f4a3343fe2e030ffdc1161d", 520 | "shasum": "" 521 | }, 522 | "require": { 523 | "php": ">=8.1" 524 | }, 525 | "require-dev": { 526 | "phpunit/phpunit": "^10.0" 527 | }, 528 | "type": "library", 529 | "extra": { 530 | "branch-alias": { 531 | "dev-main": "6.0-dev" 532 | } 533 | }, 534 | "autoload": { 535 | "classmap": [ 536 | "src/" 537 | ] 538 | }, 539 | "notification-url": "https://packagist.org/downloads/", 540 | "license": [ 541 | "BSD-3-Clause" 542 | ], 543 | "authors": [ 544 | { 545 | "name": "Sebastian Bergmann", 546 | "email": "sebastian@phpunit.de", 547 | "role": "lead" 548 | } 549 | ], 550 | "description": "Utility class for timing", 551 | "homepage": "https://github.com/sebastianbergmann/php-timer/", 552 | "keywords": [ 553 | "timer" 554 | ], 555 | "support": { 556 | "issues": "https://github.com/sebastianbergmann/php-timer/issues", 557 | "source": "https://github.com/sebastianbergmann/php-timer/tree/6.0.0" 558 | }, 559 | "funding": [ 560 | { 561 | "url": "https://github.com/sebastianbergmann", 562 | "type": "github" 563 | } 564 | ], 565 | "time": "2023-02-03T06:57:52+00:00" 566 | }, 567 | { 568 | "name": "phpunit/phpunit", 569 | "version": "10.5.39", 570 | "source": { 571 | "type": "git", 572 | "url": "https://github.com/sebastianbergmann/phpunit.git", 573 | "reference": "4e89eff200b801db58f3d580ad7426431949eaa9" 574 | }, 575 | "dist": { 576 | "type": "zip", 577 | "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/4e89eff200b801db58f3d580ad7426431949eaa9", 578 | "reference": "4e89eff200b801db58f3d580ad7426431949eaa9", 579 | "shasum": "" 580 | }, 581 | "require": { 582 | "ext-dom": "*", 583 | "ext-json": "*", 584 | "ext-libxml": "*", 585 | "ext-mbstring": "*", 586 | "ext-xml": "*", 587 | "ext-xmlwriter": "*", 588 | "myclabs/deep-copy": "^1.12.1", 589 | "phar-io/manifest": "^2.0.4", 590 | "phar-io/version": "^3.2.1", 591 | "php": ">=8.1", 592 | "phpunit/php-code-coverage": "^10.1.16", 593 | "phpunit/php-file-iterator": "^4.1.0", 594 | "phpunit/php-invoker": "^4.0.0", 595 | "phpunit/php-text-template": "^3.0.1", 596 | "phpunit/php-timer": "^6.0.0", 597 | "sebastian/cli-parser": "^2.0.1", 598 | "sebastian/code-unit": "^2.0.0", 599 | "sebastian/comparator": "^5.0.3", 600 | "sebastian/diff": "^5.1.1", 601 | "sebastian/environment": "^6.1.0", 602 | "sebastian/exporter": "^5.1.2", 603 | "sebastian/global-state": "^6.0.2", 604 | "sebastian/object-enumerator": "^5.0.0", 605 | "sebastian/recursion-context": "^5.0.0", 606 | "sebastian/type": "^4.0.0", 607 | "sebastian/version": "^4.0.1" 608 | }, 609 | "suggest": { 610 | "ext-soap": "To be able to generate mocks based on WSDL files" 611 | }, 612 | "bin": [ 613 | "phpunit" 614 | ], 615 | "type": "library", 616 | "extra": { 617 | "branch-alias": { 618 | "dev-main": "10.5-dev" 619 | } 620 | }, 621 | "autoload": { 622 | "files": [ 623 | "src/Framework/Assert/Functions.php" 624 | ], 625 | "classmap": [ 626 | "src/" 627 | ] 628 | }, 629 | "notification-url": "https://packagist.org/downloads/", 630 | "license": [ 631 | "BSD-3-Clause" 632 | ], 633 | "authors": [ 634 | { 635 | "name": "Sebastian Bergmann", 636 | "email": "sebastian@phpunit.de", 637 | "role": "lead" 638 | } 639 | ], 640 | "description": "The PHP Unit Testing framework.", 641 | "homepage": "https://phpunit.de/", 642 | "keywords": [ 643 | "phpunit", 644 | "testing", 645 | "xunit" 646 | ], 647 | "support": { 648 | "issues": "https://github.com/sebastianbergmann/phpunit/issues", 649 | "security": "https://github.com/sebastianbergmann/phpunit/security/policy", 650 | "source": "https://github.com/sebastianbergmann/phpunit/tree/10.5.39" 651 | }, 652 | "funding": [ 653 | { 654 | "url": "https://phpunit.de/sponsors.html", 655 | "type": "custom" 656 | }, 657 | { 658 | "url": "https://github.com/sebastianbergmann", 659 | "type": "github" 660 | }, 661 | { 662 | "url": "https://tidelift.com/funding/github/packagist/phpunit/phpunit", 663 | "type": "tidelift" 664 | } 665 | ], 666 | "time": "2024-12-11T10:51:07+00:00" 667 | }, 668 | { 669 | "name": "sebastian/cli-parser", 670 | "version": "2.0.1", 671 | "source": { 672 | "type": "git", 673 | "url": "https://github.com/sebastianbergmann/cli-parser.git", 674 | "reference": "c34583b87e7b7a8055bf6c450c2c77ce32a24084" 675 | }, 676 | "dist": { 677 | "type": "zip", 678 | "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/c34583b87e7b7a8055bf6c450c2c77ce32a24084", 679 | "reference": "c34583b87e7b7a8055bf6c450c2c77ce32a24084", 680 | "shasum": "" 681 | }, 682 | "require": { 683 | "php": ">=8.1" 684 | }, 685 | "require-dev": { 686 | "phpunit/phpunit": "^10.0" 687 | }, 688 | "type": "library", 689 | "extra": { 690 | "branch-alias": { 691 | "dev-main": "2.0-dev" 692 | } 693 | }, 694 | "autoload": { 695 | "classmap": [ 696 | "src/" 697 | ] 698 | }, 699 | "notification-url": "https://packagist.org/downloads/", 700 | "license": [ 701 | "BSD-3-Clause" 702 | ], 703 | "authors": [ 704 | { 705 | "name": "Sebastian Bergmann", 706 | "email": "sebastian@phpunit.de", 707 | "role": "lead" 708 | } 709 | ], 710 | "description": "Library for parsing CLI options", 711 | "homepage": "https://github.com/sebastianbergmann/cli-parser", 712 | "support": { 713 | "issues": "https://github.com/sebastianbergmann/cli-parser/issues", 714 | "security": "https://github.com/sebastianbergmann/cli-parser/security/policy", 715 | "source": "https://github.com/sebastianbergmann/cli-parser/tree/2.0.1" 716 | }, 717 | "funding": [ 718 | { 719 | "url": "https://github.com/sebastianbergmann", 720 | "type": "github" 721 | } 722 | ], 723 | "time": "2024-03-02T07:12:49+00:00" 724 | }, 725 | { 726 | "name": "sebastian/code-unit", 727 | "version": "2.0.0", 728 | "source": { 729 | "type": "git", 730 | "url": "https://github.com/sebastianbergmann/code-unit.git", 731 | "reference": "a81fee9eef0b7a76af11d121767abc44c104e503" 732 | }, 733 | "dist": { 734 | "type": "zip", 735 | "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/a81fee9eef0b7a76af11d121767abc44c104e503", 736 | "reference": "a81fee9eef0b7a76af11d121767abc44c104e503", 737 | "shasum": "" 738 | }, 739 | "require": { 740 | "php": ">=8.1" 741 | }, 742 | "require-dev": { 743 | "phpunit/phpunit": "^10.0" 744 | }, 745 | "type": "library", 746 | "extra": { 747 | "branch-alias": { 748 | "dev-main": "2.0-dev" 749 | } 750 | }, 751 | "autoload": { 752 | "classmap": [ 753 | "src/" 754 | ] 755 | }, 756 | "notification-url": "https://packagist.org/downloads/", 757 | "license": [ 758 | "BSD-3-Clause" 759 | ], 760 | "authors": [ 761 | { 762 | "name": "Sebastian Bergmann", 763 | "email": "sebastian@phpunit.de", 764 | "role": "lead" 765 | } 766 | ], 767 | "description": "Collection of value objects that represent the PHP code units", 768 | "homepage": "https://github.com/sebastianbergmann/code-unit", 769 | "support": { 770 | "issues": "https://github.com/sebastianbergmann/code-unit/issues", 771 | "source": "https://github.com/sebastianbergmann/code-unit/tree/2.0.0" 772 | }, 773 | "funding": [ 774 | { 775 | "url": "https://github.com/sebastianbergmann", 776 | "type": "github" 777 | } 778 | ], 779 | "time": "2023-02-03T06:58:43+00:00" 780 | }, 781 | { 782 | "name": "sebastian/code-unit-reverse-lookup", 783 | "version": "3.0.0", 784 | "source": { 785 | "type": "git", 786 | "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", 787 | "reference": "5e3a687f7d8ae33fb362c5c0743794bbb2420a1d" 788 | }, 789 | "dist": { 790 | "type": "zip", 791 | "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/5e3a687f7d8ae33fb362c5c0743794bbb2420a1d", 792 | "reference": "5e3a687f7d8ae33fb362c5c0743794bbb2420a1d", 793 | "shasum": "" 794 | }, 795 | "require": { 796 | "php": ">=8.1" 797 | }, 798 | "require-dev": { 799 | "phpunit/phpunit": "^10.0" 800 | }, 801 | "type": "library", 802 | "extra": { 803 | "branch-alias": { 804 | "dev-main": "3.0-dev" 805 | } 806 | }, 807 | "autoload": { 808 | "classmap": [ 809 | "src/" 810 | ] 811 | }, 812 | "notification-url": "https://packagist.org/downloads/", 813 | "license": [ 814 | "BSD-3-Clause" 815 | ], 816 | "authors": [ 817 | { 818 | "name": "Sebastian Bergmann", 819 | "email": "sebastian@phpunit.de" 820 | } 821 | ], 822 | "description": "Looks up which function or method a line of code belongs to", 823 | "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", 824 | "support": { 825 | "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", 826 | "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/3.0.0" 827 | }, 828 | "funding": [ 829 | { 830 | "url": "https://github.com/sebastianbergmann", 831 | "type": "github" 832 | } 833 | ], 834 | "time": "2023-02-03T06:59:15+00:00" 835 | }, 836 | { 837 | "name": "sebastian/comparator", 838 | "version": "5.0.3", 839 | "source": { 840 | "type": "git", 841 | "url": "https://github.com/sebastianbergmann/comparator.git", 842 | "reference": "a18251eb0b7a2dcd2f7aa3d6078b18545ef0558e" 843 | }, 844 | "dist": { 845 | "type": "zip", 846 | "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/a18251eb0b7a2dcd2f7aa3d6078b18545ef0558e", 847 | "reference": "a18251eb0b7a2dcd2f7aa3d6078b18545ef0558e", 848 | "shasum": "" 849 | }, 850 | "require": { 851 | "ext-dom": "*", 852 | "ext-mbstring": "*", 853 | "php": ">=8.1", 854 | "sebastian/diff": "^5.0", 855 | "sebastian/exporter": "^5.0" 856 | }, 857 | "require-dev": { 858 | "phpunit/phpunit": "^10.5" 859 | }, 860 | "type": "library", 861 | "extra": { 862 | "branch-alias": { 863 | "dev-main": "5.0-dev" 864 | } 865 | }, 866 | "autoload": { 867 | "classmap": [ 868 | "src/" 869 | ] 870 | }, 871 | "notification-url": "https://packagist.org/downloads/", 872 | "license": [ 873 | "BSD-3-Clause" 874 | ], 875 | "authors": [ 876 | { 877 | "name": "Sebastian Bergmann", 878 | "email": "sebastian@phpunit.de" 879 | }, 880 | { 881 | "name": "Jeff Welch", 882 | "email": "whatthejeff@gmail.com" 883 | }, 884 | { 885 | "name": "Volker Dusch", 886 | "email": "github@wallbash.com" 887 | }, 888 | { 889 | "name": "Bernhard Schussek", 890 | "email": "bschussek@2bepublished.at" 891 | } 892 | ], 893 | "description": "Provides the functionality to compare PHP values for equality", 894 | "homepage": "https://github.com/sebastianbergmann/comparator", 895 | "keywords": [ 896 | "comparator", 897 | "compare", 898 | "equality" 899 | ], 900 | "support": { 901 | "issues": "https://github.com/sebastianbergmann/comparator/issues", 902 | "security": "https://github.com/sebastianbergmann/comparator/security/policy", 903 | "source": "https://github.com/sebastianbergmann/comparator/tree/5.0.3" 904 | }, 905 | "funding": [ 906 | { 907 | "url": "https://github.com/sebastianbergmann", 908 | "type": "github" 909 | } 910 | ], 911 | "time": "2024-10-18T14:56:07+00:00" 912 | }, 913 | { 914 | "name": "sebastian/complexity", 915 | "version": "3.2.0", 916 | "source": { 917 | "type": "git", 918 | "url": "https://github.com/sebastianbergmann/complexity.git", 919 | "reference": "68ff824baeae169ec9f2137158ee529584553799" 920 | }, 921 | "dist": { 922 | "type": "zip", 923 | "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/68ff824baeae169ec9f2137158ee529584553799", 924 | "reference": "68ff824baeae169ec9f2137158ee529584553799", 925 | "shasum": "" 926 | }, 927 | "require": { 928 | "nikic/php-parser": "^4.18 || ^5.0", 929 | "php": ">=8.1" 930 | }, 931 | "require-dev": { 932 | "phpunit/phpunit": "^10.0" 933 | }, 934 | "type": "library", 935 | "extra": { 936 | "branch-alias": { 937 | "dev-main": "3.2-dev" 938 | } 939 | }, 940 | "autoload": { 941 | "classmap": [ 942 | "src/" 943 | ] 944 | }, 945 | "notification-url": "https://packagist.org/downloads/", 946 | "license": [ 947 | "BSD-3-Clause" 948 | ], 949 | "authors": [ 950 | { 951 | "name": "Sebastian Bergmann", 952 | "email": "sebastian@phpunit.de", 953 | "role": "lead" 954 | } 955 | ], 956 | "description": "Library for calculating the complexity of PHP code units", 957 | "homepage": "https://github.com/sebastianbergmann/complexity", 958 | "support": { 959 | "issues": "https://github.com/sebastianbergmann/complexity/issues", 960 | "security": "https://github.com/sebastianbergmann/complexity/security/policy", 961 | "source": "https://github.com/sebastianbergmann/complexity/tree/3.2.0" 962 | }, 963 | "funding": [ 964 | { 965 | "url": "https://github.com/sebastianbergmann", 966 | "type": "github" 967 | } 968 | ], 969 | "time": "2023-12-21T08:37:17+00:00" 970 | }, 971 | { 972 | "name": "sebastian/diff", 973 | "version": "5.1.1", 974 | "source": { 975 | "type": "git", 976 | "url": "https://github.com/sebastianbergmann/diff.git", 977 | "reference": "c41e007b4b62af48218231d6c2275e4c9b975b2e" 978 | }, 979 | "dist": { 980 | "type": "zip", 981 | "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/c41e007b4b62af48218231d6c2275e4c9b975b2e", 982 | "reference": "c41e007b4b62af48218231d6c2275e4c9b975b2e", 983 | "shasum": "" 984 | }, 985 | "require": { 986 | "php": ">=8.1" 987 | }, 988 | "require-dev": { 989 | "phpunit/phpunit": "^10.0", 990 | "symfony/process": "^6.4" 991 | }, 992 | "type": "library", 993 | "extra": { 994 | "branch-alias": { 995 | "dev-main": "5.1-dev" 996 | } 997 | }, 998 | "autoload": { 999 | "classmap": [ 1000 | "src/" 1001 | ] 1002 | }, 1003 | "notification-url": "https://packagist.org/downloads/", 1004 | "license": [ 1005 | "BSD-3-Clause" 1006 | ], 1007 | "authors": [ 1008 | { 1009 | "name": "Sebastian Bergmann", 1010 | "email": "sebastian@phpunit.de" 1011 | }, 1012 | { 1013 | "name": "Kore Nordmann", 1014 | "email": "mail@kore-nordmann.de" 1015 | } 1016 | ], 1017 | "description": "Diff implementation", 1018 | "homepage": "https://github.com/sebastianbergmann/diff", 1019 | "keywords": [ 1020 | "diff", 1021 | "udiff", 1022 | "unidiff", 1023 | "unified diff" 1024 | ], 1025 | "support": { 1026 | "issues": "https://github.com/sebastianbergmann/diff/issues", 1027 | "security": "https://github.com/sebastianbergmann/diff/security/policy", 1028 | "source": "https://github.com/sebastianbergmann/diff/tree/5.1.1" 1029 | }, 1030 | "funding": [ 1031 | { 1032 | "url": "https://github.com/sebastianbergmann", 1033 | "type": "github" 1034 | } 1035 | ], 1036 | "time": "2024-03-02T07:15:17+00:00" 1037 | }, 1038 | { 1039 | "name": "sebastian/environment", 1040 | "version": "6.1.0", 1041 | "source": { 1042 | "type": "git", 1043 | "url": "https://github.com/sebastianbergmann/environment.git", 1044 | "reference": "8074dbcd93529b357029f5cc5058fd3e43666984" 1045 | }, 1046 | "dist": { 1047 | "type": "zip", 1048 | "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/8074dbcd93529b357029f5cc5058fd3e43666984", 1049 | "reference": "8074dbcd93529b357029f5cc5058fd3e43666984", 1050 | "shasum": "" 1051 | }, 1052 | "require": { 1053 | "php": ">=8.1" 1054 | }, 1055 | "require-dev": { 1056 | "phpunit/phpunit": "^10.0" 1057 | }, 1058 | "suggest": { 1059 | "ext-posix": "*" 1060 | }, 1061 | "type": "library", 1062 | "extra": { 1063 | "branch-alias": { 1064 | "dev-main": "6.1-dev" 1065 | } 1066 | }, 1067 | "autoload": { 1068 | "classmap": [ 1069 | "src/" 1070 | ] 1071 | }, 1072 | "notification-url": "https://packagist.org/downloads/", 1073 | "license": [ 1074 | "BSD-3-Clause" 1075 | ], 1076 | "authors": [ 1077 | { 1078 | "name": "Sebastian Bergmann", 1079 | "email": "sebastian@phpunit.de" 1080 | } 1081 | ], 1082 | "description": "Provides functionality to handle HHVM/PHP environments", 1083 | "homepage": "https://github.com/sebastianbergmann/environment", 1084 | "keywords": [ 1085 | "Xdebug", 1086 | "environment", 1087 | "hhvm" 1088 | ], 1089 | "support": { 1090 | "issues": "https://github.com/sebastianbergmann/environment/issues", 1091 | "security": "https://github.com/sebastianbergmann/environment/security/policy", 1092 | "source": "https://github.com/sebastianbergmann/environment/tree/6.1.0" 1093 | }, 1094 | "funding": [ 1095 | { 1096 | "url": "https://github.com/sebastianbergmann", 1097 | "type": "github" 1098 | } 1099 | ], 1100 | "time": "2024-03-23T08:47:14+00:00" 1101 | }, 1102 | { 1103 | "name": "sebastian/exporter", 1104 | "version": "5.1.2", 1105 | "source": { 1106 | "type": "git", 1107 | "url": "https://github.com/sebastianbergmann/exporter.git", 1108 | "reference": "955288482d97c19a372d3f31006ab3f37da47adf" 1109 | }, 1110 | "dist": { 1111 | "type": "zip", 1112 | "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/955288482d97c19a372d3f31006ab3f37da47adf", 1113 | "reference": "955288482d97c19a372d3f31006ab3f37da47adf", 1114 | "shasum": "" 1115 | }, 1116 | "require": { 1117 | "ext-mbstring": "*", 1118 | "php": ">=8.1", 1119 | "sebastian/recursion-context": "^5.0" 1120 | }, 1121 | "require-dev": { 1122 | "phpunit/phpunit": "^10.0" 1123 | }, 1124 | "type": "library", 1125 | "extra": { 1126 | "branch-alias": { 1127 | "dev-main": "5.1-dev" 1128 | } 1129 | }, 1130 | "autoload": { 1131 | "classmap": [ 1132 | "src/" 1133 | ] 1134 | }, 1135 | "notification-url": "https://packagist.org/downloads/", 1136 | "license": [ 1137 | "BSD-3-Clause" 1138 | ], 1139 | "authors": [ 1140 | { 1141 | "name": "Sebastian Bergmann", 1142 | "email": "sebastian@phpunit.de" 1143 | }, 1144 | { 1145 | "name": "Jeff Welch", 1146 | "email": "whatthejeff@gmail.com" 1147 | }, 1148 | { 1149 | "name": "Volker Dusch", 1150 | "email": "github@wallbash.com" 1151 | }, 1152 | { 1153 | "name": "Adam Harvey", 1154 | "email": "aharvey@php.net" 1155 | }, 1156 | { 1157 | "name": "Bernhard Schussek", 1158 | "email": "bschussek@gmail.com" 1159 | } 1160 | ], 1161 | "description": "Provides the functionality to export PHP variables for visualization", 1162 | "homepage": "https://www.github.com/sebastianbergmann/exporter", 1163 | "keywords": [ 1164 | "export", 1165 | "exporter" 1166 | ], 1167 | "support": { 1168 | "issues": "https://github.com/sebastianbergmann/exporter/issues", 1169 | "security": "https://github.com/sebastianbergmann/exporter/security/policy", 1170 | "source": "https://github.com/sebastianbergmann/exporter/tree/5.1.2" 1171 | }, 1172 | "funding": [ 1173 | { 1174 | "url": "https://github.com/sebastianbergmann", 1175 | "type": "github" 1176 | } 1177 | ], 1178 | "time": "2024-03-02T07:17:12+00:00" 1179 | }, 1180 | { 1181 | "name": "sebastian/global-state", 1182 | "version": "6.0.2", 1183 | "source": { 1184 | "type": "git", 1185 | "url": "https://github.com/sebastianbergmann/global-state.git", 1186 | "reference": "987bafff24ecc4c9ac418cab1145b96dd6e9cbd9" 1187 | }, 1188 | "dist": { 1189 | "type": "zip", 1190 | "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/987bafff24ecc4c9ac418cab1145b96dd6e9cbd9", 1191 | "reference": "987bafff24ecc4c9ac418cab1145b96dd6e9cbd9", 1192 | "shasum": "" 1193 | }, 1194 | "require": { 1195 | "php": ">=8.1", 1196 | "sebastian/object-reflector": "^3.0", 1197 | "sebastian/recursion-context": "^5.0" 1198 | }, 1199 | "require-dev": { 1200 | "ext-dom": "*", 1201 | "phpunit/phpunit": "^10.0" 1202 | }, 1203 | "type": "library", 1204 | "extra": { 1205 | "branch-alias": { 1206 | "dev-main": "6.0-dev" 1207 | } 1208 | }, 1209 | "autoload": { 1210 | "classmap": [ 1211 | "src/" 1212 | ] 1213 | }, 1214 | "notification-url": "https://packagist.org/downloads/", 1215 | "license": [ 1216 | "BSD-3-Clause" 1217 | ], 1218 | "authors": [ 1219 | { 1220 | "name": "Sebastian Bergmann", 1221 | "email": "sebastian@phpunit.de" 1222 | } 1223 | ], 1224 | "description": "Snapshotting of global state", 1225 | "homepage": "https://www.github.com/sebastianbergmann/global-state", 1226 | "keywords": [ 1227 | "global state" 1228 | ], 1229 | "support": { 1230 | "issues": "https://github.com/sebastianbergmann/global-state/issues", 1231 | "security": "https://github.com/sebastianbergmann/global-state/security/policy", 1232 | "source": "https://github.com/sebastianbergmann/global-state/tree/6.0.2" 1233 | }, 1234 | "funding": [ 1235 | { 1236 | "url": "https://github.com/sebastianbergmann", 1237 | "type": "github" 1238 | } 1239 | ], 1240 | "time": "2024-03-02T07:19:19+00:00" 1241 | }, 1242 | { 1243 | "name": "sebastian/lines-of-code", 1244 | "version": "2.0.2", 1245 | "source": { 1246 | "type": "git", 1247 | "url": "https://github.com/sebastianbergmann/lines-of-code.git", 1248 | "reference": "856e7f6a75a84e339195d48c556f23be2ebf75d0" 1249 | }, 1250 | "dist": { 1251 | "type": "zip", 1252 | "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/856e7f6a75a84e339195d48c556f23be2ebf75d0", 1253 | "reference": "856e7f6a75a84e339195d48c556f23be2ebf75d0", 1254 | "shasum": "" 1255 | }, 1256 | "require": { 1257 | "nikic/php-parser": "^4.18 || ^5.0", 1258 | "php": ">=8.1" 1259 | }, 1260 | "require-dev": { 1261 | "phpunit/phpunit": "^10.0" 1262 | }, 1263 | "type": "library", 1264 | "extra": { 1265 | "branch-alias": { 1266 | "dev-main": "2.0-dev" 1267 | } 1268 | }, 1269 | "autoload": { 1270 | "classmap": [ 1271 | "src/" 1272 | ] 1273 | }, 1274 | "notification-url": "https://packagist.org/downloads/", 1275 | "license": [ 1276 | "BSD-3-Clause" 1277 | ], 1278 | "authors": [ 1279 | { 1280 | "name": "Sebastian Bergmann", 1281 | "email": "sebastian@phpunit.de", 1282 | "role": "lead" 1283 | } 1284 | ], 1285 | "description": "Library for counting the lines of code in PHP source code", 1286 | "homepage": "https://github.com/sebastianbergmann/lines-of-code", 1287 | "support": { 1288 | "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", 1289 | "security": "https://github.com/sebastianbergmann/lines-of-code/security/policy", 1290 | "source": "https://github.com/sebastianbergmann/lines-of-code/tree/2.0.2" 1291 | }, 1292 | "funding": [ 1293 | { 1294 | "url": "https://github.com/sebastianbergmann", 1295 | "type": "github" 1296 | } 1297 | ], 1298 | "time": "2023-12-21T08:38:20+00:00" 1299 | }, 1300 | { 1301 | "name": "sebastian/object-enumerator", 1302 | "version": "5.0.0", 1303 | "source": { 1304 | "type": "git", 1305 | "url": "https://github.com/sebastianbergmann/object-enumerator.git", 1306 | "reference": "202d0e344a580d7f7d04b3fafce6933e59dae906" 1307 | }, 1308 | "dist": { 1309 | "type": "zip", 1310 | "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/202d0e344a580d7f7d04b3fafce6933e59dae906", 1311 | "reference": "202d0e344a580d7f7d04b3fafce6933e59dae906", 1312 | "shasum": "" 1313 | }, 1314 | "require": { 1315 | "php": ">=8.1", 1316 | "sebastian/object-reflector": "^3.0", 1317 | "sebastian/recursion-context": "^5.0" 1318 | }, 1319 | "require-dev": { 1320 | "phpunit/phpunit": "^10.0" 1321 | }, 1322 | "type": "library", 1323 | "extra": { 1324 | "branch-alias": { 1325 | "dev-main": "5.0-dev" 1326 | } 1327 | }, 1328 | "autoload": { 1329 | "classmap": [ 1330 | "src/" 1331 | ] 1332 | }, 1333 | "notification-url": "https://packagist.org/downloads/", 1334 | "license": [ 1335 | "BSD-3-Clause" 1336 | ], 1337 | "authors": [ 1338 | { 1339 | "name": "Sebastian Bergmann", 1340 | "email": "sebastian@phpunit.de" 1341 | } 1342 | ], 1343 | "description": "Traverses array structures and object graphs to enumerate all referenced objects", 1344 | "homepage": "https://github.com/sebastianbergmann/object-enumerator/", 1345 | "support": { 1346 | "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", 1347 | "source": "https://github.com/sebastianbergmann/object-enumerator/tree/5.0.0" 1348 | }, 1349 | "funding": [ 1350 | { 1351 | "url": "https://github.com/sebastianbergmann", 1352 | "type": "github" 1353 | } 1354 | ], 1355 | "time": "2023-02-03T07:08:32+00:00" 1356 | }, 1357 | { 1358 | "name": "sebastian/object-reflector", 1359 | "version": "3.0.0", 1360 | "source": { 1361 | "type": "git", 1362 | "url": "https://github.com/sebastianbergmann/object-reflector.git", 1363 | "reference": "24ed13d98130f0e7122df55d06c5c4942a577957" 1364 | }, 1365 | "dist": { 1366 | "type": "zip", 1367 | "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/24ed13d98130f0e7122df55d06c5c4942a577957", 1368 | "reference": "24ed13d98130f0e7122df55d06c5c4942a577957", 1369 | "shasum": "" 1370 | }, 1371 | "require": { 1372 | "php": ">=8.1" 1373 | }, 1374 | "require-dev": { 1375 | "phpunit/phpunit": "^10.0" 1376 | }, 1377 | "type": "library", 1378 | "extra": { 1379 | "branch-alias": { 1380 | "dev-main": "3.0-dev" 1381 | } 1382 | }, 1383 | "autoload": { 1384 | "classmap": [ 1385 | "src/" 1386 | ] 1387 | }, 1388 | "notification-url": "https://packagist.org/downloads/", 1389 | "license": [ 1390 | "BSD-3-Clause" 1391 | ], 1392 | "authors": [ 1393 | { 1394 | "name": "Sebastian Bergmann", 1395 | "email": "sebastian@phpunit.de" 1396 | } 1397 | ], 1398 | "description": "Allows reflection of object attributes, including inherited and non-public ones", 1399 | "homepage": "https://github.com/sebastianbergmann/object-reflector/", 1400 | "support": { 1401 | "issues": "https://github.com/sebastianbergmann/object-reflector/issues", 1402 | "source": "https://github.com/sebastianbergmann/object-reflector/tree/3.0.0" 1403 | }, 1404 | "funding": [ 1405 | { 1406 | "url": "https://github.com/sebastianbergmann", 1407 | "type": "github" 1408 | } 1409 | ], 1410 | "time": "2023-02-03T07:06:18+00:00" 1411 | }, 1412 | { 1413 | "name": "sebastian/recursion-context", 1414 | "version": "5.0.0", 1415 | "source": { 1416 | "type": "git", 1417 | "url": "https://github.com/sebastianbergmann/recursion-context.git", 1418 | "reference": "05909fb5bc7df4c52992396d0116aed689f93712" 1419 | }, 1420 | "dist": { 1421 | "type": "zip", 1422 | "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/05909fb5bc7df4c52992396d0116aed689f93712", 1423 | "reference": "05909fb5bc7df4c52992396d0116aed689f93712", 1424 | "shasum": "" 1425 | }, 1426 | "require": { 1427 | "php": ">=8.1" 1428 | }, 1429 | "require-dev": { 1430 | "phpunit/phpunit": "^10.0" 1431 | }, 1432 | "type": "library", 1433 | "extra": { 1434 | "branch-alias": { 1435 | "dev-main": "5.0-dev" 1436 | } 1437 | }, 1438 | "autoload": { 1439 | "classmap": [ 1440 | "src/" 1441 | ] 1442 | }, 1443 | "notification-url": "https://packagist.org/downloads/", 1444 | "license": [ 1445 | "BSD-3-Clause" 1446 | ], 1447 | "authors": [ 1448 | { 1449 | "name": "Sebastian Bergmann", 1450 | "email": "sebastian@phpunit.de" 1451 | }, 1452 | { 1453 | "name": "Jeff Welch", 1454 | "email": "whatthejeff@gmail.com" 1455 | }, 1456 | { 1457 | "name": "Adam Harvey", 1458 | "email": "aharvey@php.net" 1459 | } 1460 | ], 1461 | "description": "Provides functionality to recursively process PHP variables", 1462 | "homepage": "https://github.com/sebastianbergmann/recursion-context", 1463 | "support": { 1464 | "issues": "https://github.com/sebastianbergmann/recursion-context/issues", 1465 | "source": "https://github.com/sebastianbergmann/recursion-context/tree/5.0.0" 1466 | }, 1467 | "funding": [ 1468 | { 1469 | "url": "https://github.com/sebastianbergmann", 1470 | "type": "github" 1471 | } 1472 | ], 1473 | "time": "2023-02-03T07:05:40+00:00" 1474 | }, 1475 | { 1476 | "name": "sebastian/type", 1477 | "version": "4.0.0", 1478 | "source": { 1479 | "type": "git", 1480 | "url": "https://github.com/sebastianbergmann/type.git", 1481 | "reference": "462699a16464c3944eefc02ebdd77882bd3925bf" 1482 | }, 1483 | "dist": { 1484 | "type": "zip", 1485 | "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/462699a16464c3944eefc02ebdd77882bd3925bf", 1486 | "reference": "462699a16464c3944eefc02ebdd77882bd3925bf", 1487 | "shasum": "" 1488 | }, 1489 | "require": { 1490 | "php": ">=8.1" 1491 | }, 1492 | "require-dev": { 1493 | "phpunit/phpunit": "^10.0" 1494 | }, 1495 | "type": "library", 1496 | "extra": { 1497 | "branch-alias": { 1498 | "dev-main": "4.0-dev" 1499 | } 1500 | }, 1501 | "autoload": { 1502 | "classmap": [ 1503 | "src/" 1504 | ] 1505 | }, 1506 | "notification-url": "https://packagist.org/downloads/", 1507 | "license": [ 1508 | "BSD-3-Clause" 1509 | ], 1510 | "authors": [ 1511 | { 1512 | "name": "Sebastian Bergmann", 1513 | "email": "sebastian@phpunit.de", 1514 | "role": "lead" 1515 | } 1516 | ], 1517 | "description": "Collection of value objects that represent the types of the PHP type system", 1518 | "homepage": "https://github.com/sebastianbergmann/type", 1519 | "support": { 1520 | "issues": "https://github.com/sebastianbergmann/type/issues", 1521 | "source": "https://github.com/sebastianbergmann/type/tree/4.0.0" 1522 | }, 1523 | "funding": [ 1524 | { 1525 | "url": "https://github.com/sebastianbergmann", 1526 | "type": "github" 1527 | } 1528 | ], 1529 | "time": "2023-02-03T07:10:45+00:00" 1530 | }, 1531 | { 1532 | "name": "sebastian/version", 1533 | "version": "4.0.1", 1534 | "source": { 1535 | "type": "git", 1536 | "url": "https://github.com/sebastianbergmann/version.git", 1537 | "reference": "c51fa83a5d8f43f1402e3f32a005e6262244ef17" 1538 | }, 1539 | "dist": { 1540 | "type": "zip", 1541 | "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c51fa83a5d8f43f1402e3f32a005e6262244ef17", 1542 | "reference": "c51fa83a5d8f43f1402e3f32a005e6262244ef17", 1543 | "shasum": "" 1544 | }, 1545 | "require": { 1546 | "php": ">=8.1" 1547 | }, 1548 | "type": "library", 1549 | "extra": { 1550 | "branch-alias": { 1551 | "dev-main": "4.0-dev" 1552 | } 1553 | }, 1554 | "autoload": { 1555 | "classmap": [ 1556 | "src/" 1557 | ] 1558 | }, 1559 | "notification-url": "https://packagist.org/downloads/", 1560 | "license": [ 1561 | "BSD-3-Clause" 1562 | ], 1563 | "authors": [ 1564 | { 1565 | "name": "Sebastian Bergmann", 1566 | "email": "sebastian@phpunit.de", 1567 | "role": "lead" 1568 | } 1569 | ], 1570 | "description": "Library that helps with managing the version number of Git-hosted PHP projects", 1571 | "homepage": "https://github.com/sebastianbergmann/version", 1572 | "support": { 1573 | "issues": "https://github.com/sebastianbergmann/version/issues", 1574 | "source": "https://github.com/sebastianbergmann/version/tree/4.0.1" 1575 | }, 1576 | "funding": [ 1577 | { 1578 | "url": "https://github.com/sebastianbergmann", 1579 | "type": "github" 1580 | } 1581 | ], 1582 | "time": "2023-02-07T11:34:05+00:00" 1583 | }, 1584 | { 1585 | "name": "theseer/tokenizer", 1586 | "version": "1.2.3", 1587 | "source": { 1588 | "type": "git", 1589 | "url": "https://github.com/theseer/tokenizer.git", 1590 | "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2" 1591 | }, 1592 | "dist": { 1593 | "type": "zip", 1594 | "url": "https://api.github.com/repos/theseer/tokenizer/zipball/737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2", 1595 | "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2", 1596 | "shasum": "" 1597 | }, 1598 | "require": { 1599 | "ext-dom": "*", 1600 | "ext-tokenizer": "*", 1601 | "ext-xmlwriter": "*", 1602 | "php": "^7.2 || ^8.0" 1603 | }, 1604 | "type": "library", 1605 | "autoload": { 1606 | "classmap": [ 1607 | "src/" 1608 | ] 1609 | }, 1610 | "notification-url": "https://packagist.org/downloads/", 1611 | "license": [ 1612 | "BSD-3-Clause" 1613 | ], 1614 | "authors": [ 1615 | { 1616 | "name": "Arne Blankerts", 1617 | "email": "arne@blankerts.de", 1618 | "role": "Developer" 1619 | } 1620 | ], 1621 | "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", 1622 | "support": { 1623 | "issues": "https://github.com/theseer/tokenizer/issues", 1624 | "source": "https://github.com/theseer/tokenizer/tree/1.2.3" 1625 | }, 1626 | "funding": [ 1627 | { 1628 | "url": "https://github.com/theseer", 1629 | "type": "github" 1630 | } 1631 | ], 1632 | "time": "2024-03-03T12:36:25+00:00" 1633 | } 1634 | ], 1635 | "aliases": [], 1636 | "minimum-stability": "stable", 1637 | "stability-flags": {}, 1638 | "prefer-stable": false, 1639 | "prefer-lowest": false, 1640 | "platform": { 1641 | "php": "^8.1" 1642 | }, 1643 | "platform-dev": {}, 1644 | "plugin-api-version": "2.6.0" 1645 | } 1646 | -------------------------------------------------------------------------------- /guide.md: -------------------------------------------------------------------------------- 1 | # PHP Package boilerplate project explanation 2 | 3 | PHP is a general-purpose server-side scripting language primarily used in web development. Originally created by Rasmus Lerdorf in 1994, it is now by The PHP Development Team. 4 | 5 | PHP originally stood for "Personal Home Page", but now stands for "PHP: Hypertext Preprocessor". 6 | 7 | ## Further Material 8 | 9 | - Homepage: [php.net](https://secure.php.net/) 10 | - Documentation: [php.net/docs.php](https://secure.php.net/docs.php) 11 | - PHP: The Right Way: [phptherightway.com](http://www.phptherightway.com/) 12 | - Interactive PHP Tutorial: [learn-php.org](http://www.learn-php.org/) 13 | 14 | ## Topics, Tools and Terms 15 | 16 | PHP packages were traditionally installed via PEAR (PHP Extension and Application Repository), but more recently the standard package and dependency management tool is Composer. 17 | 18 | Composer lets us run install commands to add packages to our system, for example `composer require phpunit` would add the unit testing framework PHPUnit to our system. 19 | 20 | For instructions on how to install Composer visit [getcomposer.org](https://getcomposer.org/download/). 21 | 22 | ### Dependency Management 23 | 24 | Managing dependencies manually is time-consuming, fortunately Composer can automate this. 25 | 26 | We can list our dependencies in a `composer.json` file and run `composer install` to bring these into our project. 27 | 28 | An example `composer.json` file looks like this: 29 | 30 | ```json 31 | { 32 | "name": "example-project", 33 | "require": { 34 | "twig/twig": "^3.0" 35 | }, 36 | "require-dev": { 37 | "phpunit/phpunit": "^11.5" 38 | } 39 | } 40 | ``` 41 | 42 | The "require" block tells Composer that the Twig templating package is required for production use and can install Twig with a version of 3.x.x (ie. up to, but not including, version 4). 43 | 44 | The "require-dev" block tells Composer that PHPUnit is required in development, but not in production. 45 | 46 | Dependencies can be added to `composer.json` by 47 | 48 | ```bash 49 | composer require author/package-name 50 | ``` 51 | 52 | Development dependencies can be added by 53 | 54 | ```bash 55 | composer require author/package-name --dev 56 | ``` 57 | 58 | Dependencies can be updated to their latest maximum version by running 59 | 60 | ```bash 61 | composer update 62 | ``` 63 | 64 | Composer will also generate a `composer.lock` file on each `composer update` and the initial `composer install`. This is not meant to be edited directly, it tells Composer to use specific versions of packages - particularly useful when hyhou want your development dependencies to match what you will push to production. 65 | 66 | ### Testing Tools 67 | 68 | There are a number of testing tools available for PHP. The most popular one is [PHPUnit](https://phpunit.de/). PHPUnit follows the classic xUnit approach. 69 | 70 | [Behat](http://behat.org/en/latest/) is the most popular behaviour-driven development (BDD) testing framework. 71 | 72 | [Codeception](http://codeception.com/) is a framework combining BDD, unit testing, and integration testing, and is cross-compatible with PHPUnit. 73 | 74 | In this guide we will be using PHPUnit as the testing framework. 75 | 76 | ## Directory Structure 77 | 78 | A typical directory structure for a PHP project consists of a `src` directory that contains all source files and a `tests` directory that includes all tests. For web applications the publicly accessible files (eg. `index.php`) would reside in a `public` directory which would then be your webservers document root. 79 | 80 | Another common convention is having a `bin` directory that may contain executable files to start your application. 81 | 82 | - src/ 83 | - test/ 84 | - public/ 85 | - composer.json 86 | - composer.lock 87 | 88 | ### Naming Conventions 89 | 90 | Directory names are in lower case. Class and interface files should be in upper case and match the class or interface names. 91 | Configuration, routes, and publicly accessible files should be in lower case. 92 | 93 | For example the class `Example` should be contained in file `Example.php`, the publicly accessible route to the application should be `index.php`. 94 | 95 | Tests match their production code file names with a `Test` suffix, e.g. tests for code in `src/Example.php` should be written in `test/ExampleTest.php`. 96 | 97 | ## Example Project 98 | 99 | The main application consists of basically two files: 100 | 101 | - `public/example.php` is the main executable that instantiates and runs: 102 | - `src/Example/Greeting.php` contains the main application. 103 | 104 | ### Running the Tests 105 | 106 | All tests can be run by executing 107 | 108 | ```bash 109 | vendor/phpunit/phpunit/phpunit 110 | ``` 111 | 112 | `phpunit` will automatically find all tests inside the `test` directory and run them based on the configuration in the `phpunit.xml` file. 113 | 114 | #### Testing Approach 115 | 116 | The test for the class `Greeting` verifies that the return value of the `sayHello` method returns the string "Hello {name}", where {name} is the value passed through to the constructor. 117 | 118 | ### Running the Application 119 | 120 | PHP has an in-built server for local development. To run this change into the directory `public` and run 121 | 122 | ```bash 123 | php -S localhost:8000 124 | ``` 125 | 126 | Then open your browser at `http://localhost:8000/example.php` 127 | 128 | You should see the text "Hello Ada Lovelace" being printed. 129 | -------------------------------------------------------------------------------- /phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | ./tests/ 7 | 8 | 9 | 10 | 11 | ./src/ 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /public/example.php: -------------------------------------------------------------------------------- 1 | sayHello(); 10 | -------------------------------------------------------------------------------- /src/Example/Greeting.php: -------------------------------------------------------------------------------- 1 | name; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /tests/Example/GreetingTest.php: -------------------------------------------------------------------------------- 1 | assertSame('Hello Rasmus Lerdorf', $greeting->sayHello()); 17 | } 18 | } 19 | --------------------------------------------------------------------------------