├── .github └── workflows │ └── phpunit.yml ├── .gitignore ├── LICENSE ├── README.md ├── Taskfile.yml ├── compose.yml ├── composer.json ├── composer.lock ├── docker ├── php80 │ └── Dockerfile ├── php81 │ └── Dockerfile └── php82 │ └── Dockerfile ├── docs ├── blade.md └── css_and_alt_css.md ├── php-del ├── php-del.json ├── phpunit.xml ├── src ├── Application.php ├── Comment │ ├── Comment.php │ ├── CommentPatternProvider.php │ ├── DeleteComment.php │ ├── IgnoreComment.php │ ├── LineComment.php │ ├── Pattern │ │ ├── AltCssPattern.php │ │ ├── BladePhpPattern.php │ │ ├── CommentPattern.php │ │ ├── CssPattern.php │ │ └── RawPhpPattern.php │ └── SandWitchComment.php ├── Config.php ├── Deleter.php ├── Exception │ ├── SandWitchCommentException.php │ └── UndefinedExtensionException.php ├── Factory │ └── ConfigFactory.php ├── File │ ├── AllFileList.php │ ├── FileList.php │ └── TargetFileList.php ├── Finder.php ├── Flag │ ├── Flag.php │ ├── FlagList.php │ └── FlagManager.php └── Rewriter.php └── tests ├── Unit ├── DeleterTest.php ├── FinderTest.php └── RewriterTest.php ├── actual ├── delete_flag │ ├── DeleteFlag.php │ ├── delete_flag.blade.php │ ├── delete_flag.css │ └── delete_flag.scss ├── error_flag │ ├── ErrorFlag.php │ ├── error-flag.blade.php │ ├── error-flag.css │ └── error-flag.scss ├── flag_a │ ├── FlagA.php │ ├── flag-a.blade.php │ ├── flag-a.css │ └── flag-a.scss └── flag_b │ └── FlagB.php └── expect └── flag_a ├── FlagA.php ├── flag-a.blade.php ├── flag-a.css └── flag-a.scss /.github/workflows/phpunit.yml: -------------------------------------------------------------------------------- 1 | name: Unit Test 2 | 3 | on: 4 | push: 5 | pull_request: 6 | 7 | jobs: 8 | phpunit: 9 | runs-on: ubuntu-20.04 10 | strategy: 11 | matrix: 12 | php-version: [ '8.0', '8.1', '8.2' ] 13 | steps: 14 | - uses: actions/checkout@v2 15 | - name: Setup PHP ${{ matrix.php-version }} 16 | uses: shivammathur/setup-php@v2 17 | with: 18 | php-version: ${{ matrix.php-version }} 19 | tools: composer:v2 20 | - name: Install Dependencies 21 | if: steps.cache.outputs.cache-hit != 'true' 22 | run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist 23 | - name: Execute Unit tests via PHPUnit 24 | run: vendor/bin/phpunit 25 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | vendor 3 | .phpunit.result.cache 4 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 KenjiroKubota 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 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # PHP-DEL 2 | [![Unit Test](https://github.com/kubotak-is/php-del/actions/workflows/phpunit.yml/badge.svg?branch=main)](https://github.com/kubotak-is/php-del/actions/workflows/phpunit.yml) 3 | [![Latest Stable Version](http://poser.pugx.org/kubotak-is/php-del/v)](https://packagist.org/packages/kubotak-is/php-del) 4 | [![PHP Version Require](http://poser.pugx.org/kubotak-is/php-del/require/php)](https://packagist.org/packages/kubotak-is/php-del) 5 | [![License](http://poser.pugx.org/kubotak-is/php-del/license)](https://packagist.org/packages/kubotak-is/php-del) 6 | 7 | Tool to remove code based on specific comments. 8 | 9 | ## Install 10 | ``` 11 | composer require --dev kubotak-is/php-del 12 | ``` 13 | 14 | ## Configuration 15 | Create php-del.json in the root directory of the project 16 | 17 | ```json 18 | { 19 | "dirs": [ 20 | "src" 21 | ], 22 | "extensions": [ 23 | "php" 24 | ] 25 | } 26 | ``` 27 | ### dirs 28 | Specify the directory to be searched for files. 29 | 30 | ### extensions(Optional: Default php) 31 | Specify the extension to be searched. 32 | 33 | 34 | ## Usage 35 | 36 | Add a comment with a flag for code like the following 37 | ```php 38 | public function code() { 39 | /** php-del start flag-a */ 40 | $something = 1; 41 | /** php-del end flag-a */ 42 | } 43 | ``` 44 | 45 | Run php-del from composer command. 46 | 47 | ``` 48 | /vendor/bin/php-del 49 | ``` 50 | 51 | Select the flag and enter to perform the deletion. 52 | 53 | ``` 54 | Finding flag... 55 | Please choice me one of the following flag: (press to select) 56 | ○ flag-a (1) 57 | ``` 58 | 59 | Deletion result 60 | ```php 61 | public function code() { 62 | } 63 | ``` 64 | 65 | ### One Line code delete 66 | To delete only one line. 67 | 68 | ```php 69 | use Hoge\Fuga\Piyo; // php-del line flag-a 70 | ``` 71 | 72 | ### Codes not covered 73 | The ignore comment can be added to remove it from the deletion list. 74 | 75 | ```php 76 | public function code() { 77 | /** php-del start flag-a */ 78 | $something = 1; 79 | /** php-del ignore start */ 80 | $ignore = 2; 81 | /** php-del ignore end */ 82 | /** php-del end flag-a */ 83 | } 84 | ``` 85 | 86 | Deletion result 87 | ```php 88 | public function code() { 89 | $ignore = 2; 90 | } 91 | ``` 92 | 93 | ### File delete 94 | Deletes the file itself by adding a file deletion comment. 95 | 96 | ```php 97 | =8.0", 18 | "ext-mbstring": "*", 19 | "league/climate": "^3.7" 20 | }, 21 | "bin": [ 22 | "php-del" 23 | ], 24 | "autoload": { 25 | "psr-4": { 26 | "PHPDel\\": "src/" 27 | } 28 | }, 29 | "autoload-dev": { 30 | "classmap": [ 31 | "tests/" 32 | ], 33 | "files": [ 34 | ] 35 | }, 36 | "require-dev": { 37 | "phpunit/phpunit": "^9.6" 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /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": "4a8f8ffd68d5a217056557abc25eb4ed", 8 | "packages": [ 9 | { 10 | "name": "league/climate", 11 | "version": "3.8.2", 12 | "source": { 13 | "type": "git", 14 | "url": "https://github.com/thephpleague/climate.git", 15 | "reference": "a785a3ac8f584eed4abd45e4e16fe64c46659a28" 16 | }, 17 | "dist": { 18 | "type": "zip", 19 | "url": "https://api.github.com/repos/thephpleague/climate/zipball/a785a3ac8f584eed4abd45e4e16fe64c46659a28", 20 | "reference": "a785a3ac8f584eed4abd45e4e16fe64c46659a28", 21 | "shasum": "" 22 | }, 23 | "require": { 24 | "php": "^7.3 || ^8.0", 25 | "psr/log": "^1.0 || ^2.0 || ^3.0", 26 | "seld/cli-prompt": "^1.0" 27 | }, 28 | "require-dev": { 29 | "mikey179/vfsstream": "^1.6.10", 30 | "mockery/mockery": "^1.4.2", 31 | "phpunit/phpunit": "^9.5.10" 32 | }, 33 | "suggest": { 34 | "ext-mbstring": "If ext-mbstring is not available you MUST install symfony/polyfill-mbstring" 35 | }, 36 | "type": "library", 37 | "autoload": { 38 | "psr-4": { 39 | "League\\CLImate\\": "src/" 40 | } 41 | }, 42 | "notification-url": "https://packagist.org/downloads/", 43 | "license": [ 44 | "MIT" 45 | ], 46 | "authors": [ 47 | { 48 | "name": "Joe Tannenbaum", 49 | "email": "hey@joe.codes", 50 | "homepage": "http://joe.codes/", 51 | "role": "Developer" 52 | }, 53 | { 54 | "name": "Craig Duncan", 55 | "email": "git@duncanc.co.uk", 56 | "homepage": "https://github.com/duncan3dc", 57 | "role": "Developer" 58 | } 59 | ], 60 | "description": "PHP's best friend for the terminal. CLImate allows you to easily output colored text, special formats, and more.", 61 | "keywords": [ 62 | "cli", 63 | "colors", 64 | "command", 65 | "php", 66 | "terminal" 67 | ], 68 | "support": { 69 | "issues": "https://github.com/thephpleague/climate/issues", 70 | "source": "https://github.com/thephpleague/climate/tree/3.8.2" 71 | }, 72 | "time": "2022-06-18T14:42:08+00:00" 73 | }, 74 | { 75 | "name": "psr/log", 76 | "version": "3.0.0", 77 | "source": { 78 | "type": "git", 79 | "url": "https://github.com/php-fig/log.git", 80 | "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001" 81 | }, 82 | "dist": { 83 | "type": "zip", 84 | "url": "https://api.github.com/repos/php-fig/log/zipball/fe5ea303b0887d5caefd3d431c3e61ad47037001", 85 | "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001", 86 | "shasum": "" 87 | }, 88 | "require": { 89 | "php": ">=8.0.0" 90 | }, 91 | "type": "library", 92 | "extra": { 93 | "branch-alias": { 94 | "dev-master": "3.x-dev" 95 | } 96 | }, 97 | "autoload": { 98 | "psr-4": { 99 | "Psr\\Log\\": "src" 100 | } 101 | }, 102 | "notification-url": "https://packagist.org/downloads/", 103 | "license": [ 104 | "MIT" 105 | ], 106 | "authors": [ 107 | { 108 | "name": "PHP-FIG", 109 | "homepage": "https://www.php-fig.org/" 110 | } 111 | ], 112 | "description": "Common interface for logging libraries", 113 | "homepage": "https://github.com/php-fig/log", 114 | "keywords": [ 115 | "log", 116 | "psr", 117 | "psr-3" 118 | ], 119 | "support": { 120 | "source": "https://github.com/php-fig/log/tree/3.0.0" 121 | }, 122 | "time": "2021-07-14T16:46:02+00:00" 123 | }, 124 | { 125 | "name": "seld/cli-prompt", 126 | "version": "1.0.4", 127 | "source": { 128 | "type": "git", 129 | "url": "https://github.com/Seldaek/cli-prompt.git", 130 | "reference": "b8dfcf02094b8c03b40322c229493bb2884423c5" 131 | }, 132 | "dist": { 133 | "type": "zip", 134 | "url": "https://api.github.com/repos/Seldaek/cli-prompt/zipball/b8dfcf02094b8c03b40322c229493bb2884423c5", 135 | "reference": "b8dfcf02094b8c03b40322c229493bb2884423c5", 136 | "shasum": "" 137 | }, 138 | "require": { 139 | "php": ">=5.3" 140 | }, 141 | "require-dev": { 142 | "phpstan/phpstan": "^0.12.63" 143 | }, 144 | "type": "library", 145 | "extra": { 146 | "branch-alias": { 147 | "dev-master": "1.x-dev" 148 | } 149 | }, 150 | "autoload": { 151 | "psr-4": { 152 | "Seld\\CliPrompt\\": "src/" 153 | } 154 | }, 155 | "notification-url": "https://packagist.org/downloads/", 156 | "license": [ 157 | "MIT" 158 | ], 159 | "authors": [ 160 | { 161 | "name": "Jordi Boggiano", 162 | "email": "j.boggiano@seld.be" 163 | } 164 | ], 165 | "description": "Allows you to prompt for user input on the command line, and optionally hide the characters they type", 166 | "keywords": [ 167 | "cli", 168 | "console", 169 | "hidden", 170 | "input", 171 | "prompt" 172 | ], 173 | "support": { 174 | "issues": "https://github.com/Seldaek/cli-prompt/issues", 175 | "source": "https://github.com/Seldaek/cli-prompt/tree/1.0.4" 176 | }, 177 | "time": "2020-12-15T21:32:01+00:00" 178 | } 179 | ], 180 | "packages-dev": [ 181 | { 182 | "name": "doctrine/instantiator", 183 | "version": "1.5.0", 184 | "source": { 185 | "type": "git", 186 | "url": "https://github.com/doctrine/instantiator.git", 187 | "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b" 188 | }, 189 | "dist": { 190 | "type": "zip", 191 | "url": "https://api.github.com/repos/doctrine/instantiator/zipball/0a0fa9780f5d4e507415a065172d26a98d02047b", 192 | "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b", 193 | "shasum": "" 194 | }, 195 | "require": { 196 | "php": "^7.1 || ^8.0" 197 | }, 198 | "require-dev": { 199 | "doctrine/coding-standard": "^9 || ^11", 200 | "ext-pdo": "*", 201 | "ext-phar": "*", 202 | "phpbench/phpbench": "^0.16 || ^1", 203 | "phpstan/phpstan": "^1.4", 204 | "phpstan/phpstan-phpunit": "^1", 205 | "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", 206 | "vimeo/psalm": "^4.30 || ^5.4" 207 | }, 208 | "type": "library", 209 | "autoload": { 210 | "psr-4": { 211 | "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" 212 | } 213 | }, 214 | "notification-url": "https://packagist.org/downloads/", 215 | "license": [ 216 | "MIT" 217 | ], 218 | "authors": [ 219 | { 220 | "name": "Marco Pivetta", 221 | "email": "ocramius@gmail.com", 222 | "homepage": "https://ocramius.github.io/" 223 | } 224 | ], 225 | "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", 226 | "homepage": "https://www.doctrine-project.org/projects/instantiator.html", 227 | "keywords": [ 228 | "constructor", 229 | "instantiate" 230 | ], 231 | "support": { 232 | "issues": "https://github.com/doctrine/instantiator/issues", 233 | "source": "https://github.com/doctrine/instantiator/tree/1.5.0" 234 | }, 235 | "funding": [ 236 | { 237 | "url": "https://www.doctrine-project.org/sponsorship.html", 238 | "type": "custom" 239 | }, 240 | { 241 | "url": "https://www.patreon.com/phpdoctrine", 242 | "type": "patreon" 243 | }, 244 | { 245 | "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator", 246 | "type": "tidelift" 247 | } 248 | ], 249 | "time": "2022-12-30T00:15:36+00:00" 250 | }, 251 | { 252 | "name": "myclabs/deep-copy", 253 | "version": "1.11.1", 254 | "source": { 255 | "type": "git", 256 | "url": "https://github.com/myclabs/DeepCopy.git", 257 | "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c" 258 | }, 259 | "dist": { 260 | "type": "zip", 261 | "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", 262 | "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", 263 | "shasum": "" 264 | }, 265 | "require": { 266 | "php": "^7.1 || ^8.0" 267 | }, 268 | "conflict": { 269 | "doctrine/collections": "<1.6.8", 270 | "doctrine/common": "<2.13.3 || >=3,<3.2.2" 271 | }, 272 | "require-dev": { 273 | "doctrine/collections": "^1.6.8", 274 | "doctrine/common": "^2.13.3 || ^3.2.2", 275 | "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" 276 | }, 277 | "type": "library", 278 | "autoload": { 279 | "files": [ 280 | "src/DeepCopy/deep_copy.php" 281 | ], 282 | "psr-4": { 283 | "DeepCopy\\": "src/DeepCopy/" 284 | } 285 | }, 286 | "notification-url": "https://packagist.org/downloads/", 287 | "license": [ 288 | "MIT" 289 | ], 290 | "description": "Create deep copies (clones) of your objects", 291 | "keywords": [ 292 | "clone", 293 | "copy", 294 | "duplicate", 295 | "object", 296 | "object graph" 297 | ], 298 | "support": { 299 | "issues": "https://github.com/myclabs/DeepCopy/issues", 300 | "source": "https://github.com/myclabs/DeepCopy/tree/1.11.1" 301 | }, 302 | "funding": [ 303 | { 304 | "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", 305 | "type": "tidelift" 306 | } 307 | ], 308 | "time": "2023-03-08T13:26:56+00:00" 309 | }, 310 | { 311 | "name": "nikic/php-parser", 312 | "version": "v4.16.0", 313 | "source": { 314 | "type": "git", 315 | "url": "https://github.com/nikic/PHP-Parser.git", 316 | "reference": "19526a33fb561ef417e822e85f08a00db4059c17" 317 | }, 318 | "dist": { 319 | "type": "zip", 320 | "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/19526a33fb561ef417e822e85f08a00db4059c17", 321 | "reference": "19526a33fb561ef417e822e85f08a00db4059c17", 322 | "shasum": "" 323 | }, 324 | "require": { 325 | "ext-tokenizer": "*", 326 | "php": ">=7.0" 327 | }, 328 | "require-dev": { 329 | "ircmaxell/php-yacc": "^0.0.7", 330 | "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0" 331 | }, 332 | "bin": [ 333 | "bin/php-parse" 334 | ], 335 | "type": "library", 336 | "extra": { 337 | "branch-alias": { 338 | "dev-master": "4.9-dev" 339 | } 340 | }, 341 | "autoload": { 342 | "psr-4": { 343 | "PhpParser\\": "lib/PhpParser" 344 | } 345 | }, 346 | "notification-url": "https://packagist.org/downloads/", 347 | "license": [ 348 | "BSD-3-Clause" 349 | ], 350 | "authors": [ 351 | { 352 | "name": "Nikita Popov" 353 | } 354 | ], 355 | "description": "A PHP parser written in PHP", 356 | "keywords": [ 357 | "parser", 358 | "php" 359 | ], 360 | "support": { 361 | "issues": "https://github.com/nikic/PHP-Parser/issues", 362 | "source": "https://github.com/nikic/PHP-Parser/tree/v4.16.0" 363 | }, 364 | "time": "2023-06-25T14:52:30+00:00" 365 | }, 366 | { 367 | "name": "phar-io/manifest", 368 | "version": "2.0.3", 369 | "source": { 370 | "type": "git", 371 | "url": "https://github.com/phar-io/manifest.git", 372 | "reference": "97803eca37d319dfa7826cc2437fc020857acb53" 373 | }, 374 | "dist": { 375 | "type": "zip", 376 | "url": "https://api.github.com/repos/phar-io/manifest/zipball/97803eca37d319dfa7826cc2437fc020857acb53", 377 | "reference": "97803eca37d319dfa7826cc2437fc020857acb53", 378 | "shasum": "" 379 | }, 380 | "require": { 381 | "ext-dom": "*", 382 | "ext-phar": "*", 383 | "ext-xmlwriter": "*", 384 | "phar-io/version": "^3.0.1", 385 | "php": "^7.2 || ^8.0" 386 | }, 387 | "type": "library", 388 | "extra": { 389 | "branch-alias": { 390 | "dev-master": "2.0.x-dev" 391 | } 392 | }, 393 | "autoload": { 394 | "classmap": [ 395 | "src/" 396 | ] 397 | }, 398 | "notification-url": "https://packagist.org/downloads/", 399 | "license": [ 400 | "BSD-3-Clause" 401 | ], 402 | "authors": [ 403 | { 404 | "name": "Arne Blankerts", 405 | "email": "arne@blankerts.de", 406 | "role": "Developer" 407 | }, 408 | { 409 | "name": "Sebastian Heuer", 410 | "email": "sebastian@phpeople.de", 411 | "role": "Developer" 412 | }, 413 | { 414 | "name": "Sebastian Bergmann", 415 | "email": "sebastian@phpunit.de", 416 | "role": "Developer" 417 | } 418 | ], 419 | "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", 420 | "support": { 421 | "issues": "https://github.com/phar-io/manifest/issues", 422 | "source": "https://github.com/phar-io/manifest/tree/2.0.3" 423 | }, 424 | "time": "2021-07-20T11:28:43+00:00" 425 | }, 426 | { 427 | "name": "phar-io/version", 428 | "version": "3.2.1", 429 | "source": { 430 | "type": "git", 431 | "url": "https://github.com/phar-io/version.git", 432 | "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74" 433 | }, 434 | "dist": { 435 | "type": "zip", 436 | "url": "https://api.github.com/repos/phar-io/version/zipball/4f7fd7836c6f332bb2933569e566a0d6c4cbed74", 437 | "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74", 438 | "shasum": "" 439 | }, 440 | "require": { 441 | "php": "^7.2 || ^8.0" 442 | }, 443 | "type": "library", 444 | "autoload": { 445 | "classmap": [ 446 | "src/" 447 | ] 448 | }, 449 | "notification-url": "https://packagist.org/downloads/", 450 | "license": [ 451 | "BSD-3-Clause" 452 | ], 453 | "authors": [ 454 | { 455 | "name": "Arne Blankerts", 456 | "email": "arne@blankerts.de", 457 | "role": "Developer" 458 | }, 459 | { 460 | "name": "Sebastian Heuer", 461 | "email": "sebastian@phpeople.de", 462 | "role": "Developer" 463 | }, 464 | { 465 | "name": "Sebastian Bergmann", 466 | "email": "sebastian@phpunit.de", 467 | "role": "Developer" 468 | } 469 | ], 470 | "description": "Library for handling version information and constraints", 471 | "support": { 472 | "issues": "https://github.com/phar-io/version/issues", 473 | "source": "https://github.com/phar-io/version/tree/3.2.1" 474 | }, 475 | "time": "2022-02-21T01:04:05+00:00" 476 | }, 477 | { 478 | "name": "phpunit/php-code-coverage", 479 | "version": "9.2.26", 480 | "source": { 481 | "type": "git", 482 | "url": "https://github.com/sebastianbergmann/php-code-coverage.git", 483 | "reference": "443bc6912c9bd5b409254a40f4b0f4ced7c80ea1" 484 | }, 485 | "dist": { 486 | "type": "zip", 487 | "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/443bc6912c9bd5b409254a40f4b0f4ced7c80ea1", 488 | "reference": "443bc6912c9bd5b409254a40f4b0f4ced7c80ea1", 489 | "shasum": "" 490 | }, 491 | "require": { 492 | "ext-dom": "*", 493 | "ext-libxml": "*", 494 | "ext-xmlwriter": "*", 495 | "nikic/php-parser": "^4.15", 496 | "php": ">=7.3", 497 | "phpunit/php-file-iterator": "^3.0.3", 498 | "phpunit/php-text-template": "^2.0.2", 499 | "sebastian/code-unit-reverse-lookup": "^2.0.2", 500 | "sebastian/complexity": "^2.0", 501 | "sebastian/environment": "^5.1.2", 502 | "sebastian/lines-of-code": "^1.0.3", 503 | "sebastian/version": "^3.0.1", 504 | "theseer/tokenizer": "^1.2.0" 505 | }, 506 | "require-dev": { 507 | "phpunit/phpunit": "^9.3" 508 | }, 509 | "suggest": { 510 | "ext-pcov": "PHP extension that provides line coverage", 511 | "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" 512 | }, 513 | "type": "library", 514 | "extra": { 515 | "branch-alias": { 516 | "dev-master": "9.2-dev" 517 | } 518 | }, 519 | "autoload": { 520 | "classmap": [ 521 | "src/" 522 | ] 523 | }, 524 | "notification-url": "https://packagist.org/downloads/", 525 | "license": [ 526 | "BSD-3-Clause" 527 | ], 528 | "authors": [ 529 | { 530 | "name": "Sebastian Bergmann", 531 | "email": "sebastian@phpunit.de", 532 | "role": "lead" 533 | } 534 | ], 535 | "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", 536 | "homepage": "https://github.com/sebastianbergmann/php-code-coverage", 537 | "keywords": [ 538 | "coverage", 539 | "testing", 540 | "xunit" 541 | ], 542 | "support": { 543 | "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", 544 | "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.26" 545 | }, 546 | "funding": [ 547 | { 548 | "url": "https://github.com/sebastianbergmann", 549 | "type": "github" 550 | } 551 | ], 552 | "time": "2023-03-06T12:58:08+00:00" 553 | }, 554 | { 555 | "name": "phpunit/php-file-iterator", 556 | "version": "3.0.6", 557 | "source": { 558 | "type": "git", 559 | "url": "https://github.com/sebastianbergmann/php-file-iterator.git", 560 | "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf" 561 | }, 562 | "dist": { 563 | "type": "zip", 564 | "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", 565 | "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", 566 | "shasum": "" 567 | }, 568 | "require": { 569 | "php": ">=7.3" 570 | }, 571 | "require-dev": { 572 | "phpunit/phpunit": "^9.3" 573 | }, 574 | "type": "library", 575 | "extra": { 576 | "branch-alias": { 577 | "dev-master": "3.0-dev" 578 | } 579 | }, 580 | "autoload": { 581 | "classmap": [ 582 | "src/" 583 | ] 584 | }, 585 | "notification-url": "https://packagist.org/downloads/", 586 | "license": [ 587 | "BSD-3-Clause" 588 | ], 589 | "authors": [ 590 | { 591 | "name": "Sebastian Bergmann", 592 | "email": "sebastian@phpunit.de", 593 | "role": "lead" 594 | } 595 | ], 596 | "description": "FilterIterator implementation that filters files based on a list of suffixes.", 597 | "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", 598 | "keywords": [ 599 | "filesystem", 600 | "iterator" 601 | ], 602 | "support": { 603 | "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", 604 | "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.6" 605 | }, 606 | "funding": [ 607 | { 608 | "url": "https://github.com/sebastianbergmann", 609 | "type": "github" 610 | } 611 | ], 612 | "time": "2021-12-02T12:48:52+00:00" 613 | }, 614 | { 615 | "name": "phpunit/php-invoker", 616 | "version": "3.1.1", 617 | "source": { 618 | "type": "git", 619 | "url": "https://github.com/sebastianbergmann/php-invoker.git", 620 | "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67" 621 | }, 622 | "dist": { 623 | "type": "zip", 624 | "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/5a10147d0aaf65b58940a0b72f71c9ac0423cc67", 625 | "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67", 626 | "shasum": "" 627 | }, 628 | "require": { 629 | "php": ">=7.3" 630 | }, 631 | "require-dev": { 632 | "ext-pcntl": "*", 633 | "phpunit/phpunit": "^9.3" 634 | }, 635 | "suggest": { 636 | "ext-pcntl": "*" 637 | }, 638 | "type": "library", 639 | "extra": { 640 | "branch-alias": { 641 | "dev-master": "3.1-dev" 642 | } 643 | }, 644 | "autoload": { 645 | "classmap": [ 646 | "src/" 647 | ] 648 | }, 649 | "notification-url": "https://packagist.org/downloads/", 650 | "license": [ 651 | "BSD-3-Clause" 652 | ], 653 | "authors": [ 654 | { 655 | "name": "Sebastian Bergmann", 656 | "email": "sebastian@phpunit.de", 657 | "role": "lead" 658 | } 659 | ], 660 | "description": "Invoke callables with a timeout", 661 | "homepage": "https://github.com/sebastianbergmann/php-invoker/", 662 | "keywords": [ 663 | "process" 664 | ], 665 | "support": { 666 | "issues": "https://github.com/sebastianbergmann/php-invoker/issues", 667 | "source": "https://github.com/sebastianbergmann/php-invoker/tree/3.1.1" 668 | }, 669 | "funding": [ 670 | { 671 | "url": "https://github.com/sebastianbergmann", 672 | "type": "github" 673 | } 674 | ], 675 | "time": "2020-09-28T05:58:55+00:00" 676 | }, 677 | { 678 | "name": "phpunit/php-text-template", 679 | "version": "2.0.4", 680 | "source": { 681 | "type": "git", 682 | "url": "https://github.com/sebastianbergmann/php-text-template.git", 683 | "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28" 684 | }, 685 | "dist": { 686 | "type": "zip", 687 | "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", 688 | "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", 689 | "shasum": "" 690 | }, 691 | "require": { 692 | "php": ">=7.3" 693 | }, 694 | "require-dev": { 695 | "phpunit/phpunit": "^9.3" 696 | }, 697 | "type": "library", 698 | "extra": { 699 | "branch-alias": { 700 | "dev-master": "2.0-dev" 701 | } 702 | }, 703 | "autoload": { 704 | "classmap": [ 705 | "src/" 706 | ] 707 | }, 708 | "notification-url": "https://packagist.org/downloads/", 709 | "license": [ 710 | "BSD-3-Clause" 711 | ], 712 | "authors": [ 713 | { 714 | "name": "Sebastian Bergmann", 715 | "email": "sebastian@phpunit.de", 716 | "role": "lead" 717 | } 718 | ], 719 | "description": "Simple template engine.", 720 | "homepage": "https://github.com/sebastianbergmann/php-text-template/", 721 | "keywords": [ 722 | "template" 723 | ], 724 | "support": { 725 | "issues": "https://github.com/sebastianbergmann/php-text-template/issues", 726 | "source": "https://github.com/sebastianbergmann/php-text-template/tree/2.0.4" 727 | }, 728 | "funding": [ 729 | { 730 | "url": "https://github.com/sebastianbergmann", 731 | "type": "github" 732 | } 733 | ], 734 | "time": "2020-10-26T05:33:50+00:00" 735 | }, 736 | { 737 | "name": "phpunit/php-timer", 738 | "version": "5.0.3", 739 | "source": { 740 | "type": "git", 741 | "url": "https://github.com/sebastianbergmann/php-timer.git", 742 | "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2" 743 | }, 744 | "dist": { 745 | "type": "zip", 746 | "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", 747 | "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", 748 | "shasum": "" 749 | }, 750 | "require": { 751 | "php": ">=7.3" 752 | }, 753 | "require-dev": { 754 | "phpunit/phpunit": "^9.3" 755 | }, 756 | "type": "library", 757 | "extra": { 758 | "branch-alias": { 759 | "dev-master": "5.0-dev" 760 | } 761 | }, 762 | "autoload": { 763 | "classmap": [ 764 | "src/" 765 | ] 766 | }, 767 | "notification-url": "https://packagist.org/downloads/", 768 | "license": [ 769 | "BSD-3-Clause" 770 | ], 771 | "authors": [ 772 | { 773 | "name": "Sebastian Bergmann", 774 | "email": "sebastian@phpunit.de", 775 | "role": "lead" 776 | } 777 | ], 778 | "description": "Utility class for timing", 779 | "homepage": "https://github.com/sebastianbergmann/php-timer/", 780 | "keywords": [ 781 | "timer" 782 | ], 783 | "support": { 784 | "issues": "https://github.com/sebastianbergmann/php-timer/issues", 785 | "source": "https://github.com/sebastianbergmann/php-timer/tree/5.0.3" 786 | }, 787 | "funding": [ 788 | { 789 | "url": "https://github.com/sebastianbergmann", 790 | "type": "github" 791 | } 792 | ], 793 | "time": "2020-10-26T13:16:10+00:00" 794 | }, 795 | { 796 | "name": "phpunit/phpunit", 797 | "version": "9.6.10", 798 | "source": { 799 | "type": "git", 800 | "url": "https://github.com/sebastianbergmann/phpunit.git", 801 | "reference": "a6d351645c3fe5a30f5e86be6577d946af65a328" 802 | }, 803 | "dist": { 804 | "type": "zip", 805 | "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/a6d351645c3fe5a30f5e86be6577d946af65a328", 806 | "reference": "a6d351645c3fe5a30f5e86be6577d946af65a328", 807 | "shasum": "" 808 | }, 809 | "require": { 810 | "doctrine/instantiator": "^1.3.1 || ^2", 811 | "ext-dom": "*", 812 | "ext-json": "*", 813 | "ext-libxml": "*", 814 | "ext-mbstring": "*", 815 | "ext-xml": "*", 816 | "ext-xmlwriter": "*", 817 | "myclabs/deep-copy": "^1.10.1", 818 | "phar-io/manifest": "^2.0.3", 819 | "phar-io/version": "^3.0.2", 820 | "php": ">=7.3", 821 | "phpunit/php-code-coverage": "^9.2.13", 822 | "phpunit/php-file-iterator": "^3.0.5", 823 | "phpunit/php-invoker": "^3.1.1", 824 | "phpunit/php-text-template": "^2.0.3", 825 | "phpunit/php-timer": "^5.0.2", 826 | "sebastian/cli-parser": "^1.0.1", 827 | "sebastian/code-unit": "^1.0.6", 828 | "sebastian/comparator": "^4.0.8", 829 | "sebastian/diff": "^4.0.3", 830 | "sebastian/environment": "^5.1.3", 831 | "sebastian/exporter": "^4.0.5", 832 | "sebastian/global-state": "^5.0.1", 833 | "sebastian/object-enumerator": "^4.0.3", 834 | "sebastian/resource-operations": "^3.0.3", 835 | "sebastian/type": "^3.2", 836 | "sebastian/version": "^3.0.2" 837 | }, 838 | "suggest": { 839 | "ext-soap": "To be able to generate mocks based on WSDL files", 840 | "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" 841 | }, 842 | "bin": [ 843 | "phpunit" 844 | ], 845 | "type": "library", 846 | "extra": { 847 | "branch-alias": { 848 | "dev-master": "9.6-dev" 849 | } 850 | }, 851 | "autoload": { 852 | "files": [ 853 | "src/Framework/Assert/Functions.php" 854 | ], 855 | "classmap": [ 856 | "src/" 857 | ] 858 | }, 859 | "notification-url": "https://packagist.org/downloads/", 860 | "license": [ 861 | "BSD-3-Clause" 862 | ], 863 | "authors": [ 864 | { 865 | "name": "Sebastian Bergmann", 866 | "email": "sebastian@phpunit.de", 867 | "role": "lead" 868 | } 869 | ], 870 | "description": "The PHP Unit Testing framework.", 871 | "homepage": "https://phpunit.de/", 872 | "keywords": [ 873 | "phpunit", 874 | "testing", 875 | "xunit" 876 | ], 877 | "support": { 878 | "issues": "https://github.com/sebastianbergmann/phpunit/issues", 879 | "security": "https://github.com/sebastianbergmann/phpunit/security/policy", 880 | "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.10" 881 | }, 882 | "funding": [ 883 | { 884 | "url": "https://phpunit.de/sponsors.html", 885 | "type": "custom" 886 | }, 887 | { 888 | "url": "https://github.com/sebastianbergmann", 889 | "type": "github" 890 | }, 891 | { 892 | "url": "https://tidelift.com/funding/github/packagist/phpunit/phpunit", 893 | "type": "tidelift" 894 | } 895 | ], 896 | "time": "2023-07-10T04:04:23+00:00" 897 | }, 898 | { 899 | "name": "sebastian/cli-parser", 900 | "version": "1.0.1", 901 | "source": { 902 | "type": "git", 903 | "url": "https://github.com/sebastianbergmann/cli-parser.git", 904 | "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2" 905 | }, 906 | "dist": { 907 | "type": "zip", 908 | "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/442e7c7e687e42adc03470c7b668bc4b2402c0b2", 909 | "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2", 910 | "shasum": "" 911 | }, 912 | "require": { 913 | "php": ">=7.3" 914 | }, 915 | "require-dev": { 916 | "phpunit/phpunit": "^9.3" 917 | }, 918 | "type": "library", 919 | "extra": { 920 | "branch-alias": { 921 | "dev-master": "1.0-dev" 922 | } 923 | }, 924 | "autoload": { 925 | "classmap": [ 926 | "src/" 927 | ] 928 | }, 929 | "notification-url": "https://packagist.org/downloads/", 930 | "license": [ 931 | "BSD-3-Clause" 932 | ], 933 | "authors": [ 934 | { 935 | "name": "Sebastian Bergmann", 936 | "email": "sebastian@phpunit.de", 937 | "role": "lead" 938 | } 939 | ], 940 | "description": "Library for parsing CLI options", 941 | "homepage": "https://github.com/sebastianbergmann/cli-parser", 942 | "support": { 943 | "issues": "https://github.com/sebastianbergmann/cli-parser/issues", 944 | "source": "https://github.com/sebastianbergmann/cli-parser/tree/1.0.1" 945 | }, 946 | "funding": [ 947 | { 948 | "url": "https://github.com/sebastianbergmann", 949 | "type": "github" 950 | } 951 | ], 952 | "time": "2020-09-28T06:08:49+00:00" 953 | }, 954 | { 955 | "name": "sebastian/code-unit", 956 | "version": "1.0.8", 957 | "source": { 958 | "type": "git", 959 | "url": "https://github.com/sebastianbergmann/code-unit.git", 960 | "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120" 961 | }, 962 | "dist": { 963 | "type": "zip", 964 | "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/1fc9f64c0927627ef78ba436c9b17d967e68e120", 965 | "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120", 966 | "shasum": "" 967 | }, 968 | "require": { 969 | "php": ">=7.3" 970 | }, 971 | "require-dev": { 972 | "phpunit/phpunit": "^9.3" 973 | }, 974 | "type": "library", 975 | "extra": { 976 | "branch-alias": { 977 | "dev-master": "1.0-dev" 978 | } 979 | }, 980 | "autoload": { 981 | "classmap": [ 982 | "src/" 983 | ] 984 | }, 985 | "notification-url": "https://packagist.org/downloads/", 986 | "license": [ 987 | "BSD-3-Clause" 988 | ], 989 | "authors": [ 990 | { 991 | "name": "Sebastian Bergmann", 992 | "email": "sebastian@phpunit.de", 993 | "role": "lead" 994 | } 995 | ], 996 | "description": "Collection of value objects that represent the PHP code units", 997 | "homepage": "https://github.com/sebastianbergmann/code-unit", 998 | "support": { 999 | "issues": "https://github.com/sebastianbergmann/code-unit/issues", 1000 | "source": "https://github.com/sebastianbergmann/code-unit/tree/1.0.8" 1001 | }, 1002 | "funding": [ 1003 | { 1004 | "url": "https://github.com/sebastianbergmann", 1005 | "type": "github" 1006 | } 1007 | ], 1008 | "time": "2020-10-26T13:08:54+00:00" 1009 | }, 1010 | { 1011 | "name": "sebastian/code-unit-reverse-lookup", 1012 | "version": "2.0.3", 1013 | "source": { 1014 | "type": "git", 1015 | "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", 1016 | "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5" 1017 | }, 1018 | "dist": { 1019 | "type": "zip", 1020 | "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", 1021 | "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", 1022 | "shasum": "" 1023 | }, 1024 | "require": { 1025 | "php": ">=7.3" 1026 | }, 1027 | "require-dev": { 1028 | "phpunit/phpunit": "^9.3" 1029 | }, 1030 | "type": "library", 1031 | "extra": { 1032 | "branch-alias": { 1033 | "dev-master": "2.0-dev" 1034 | } 1035 | }, 1036 | "autoload": { 1037 | "classmap": [ 1038 | "src/" 1039 | ] 1040 | }, 1041 | "notification-url": "https://packagist.org/downloads/", 1042 | "license": [ 1043 | "BSD-3-Clause" 1044 | ], 1045 | "authors": [ 1046 | { 1047 | "name": "Sebastian Bergmann", 1048 | "email": "sebastian@phpunit.de" 1049 | } 1050 | ], 1051 | "description": "Looks up which function or method a line of code belongs to", 1052 | "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", 1053 | "support": { 1054 | "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", 1055 | "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/2.0.3" 1056 | }, 1057 | "funding": [ 1058 | { 1059 | "url": "https://github.com/sebastianbergmann", 1060 | "type": "github" 1061 | } 1062 | ], 1063 | "time": "2020-09-28T05:30:19+00:00" 1064 | }, 1065 | { 1066 | "name": "sebastian/comparator", 1067 | "version": "4.0.8", 1068 | "source": { 1069 | "type": "git", 1070 | "url": "https://github.com/sebastianbergmann/comparator.git", 1071 | "reference": "fa0f136dd2334583309d32b62544682ee972b51a" 1072 | }, 1073 | "dist": { 1074 | "type": "zip", 1075 | "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/fa0f136dd2334583309d32b62544682ee972b51a", 1076 | "reference": "fa0f136dd2334583309d32b62544682ee972b51a", 1077 | "shasum": "" 1078 | }, 1079 | "require": { 1080 | "php": ">=7.3", 1081 | "sebastian/diff": "^4.0", 1082 | "sebastian/exporter": "^4.0" 1083 | }, 1084 | "require-dev": { 1085 | "phpunit/phpunit": "^9.3" 1086 | }, 1087 | "type": "library", 1088 | "extra": { 1089 | "branch-alias": { 1090 | "dev-master": "4.0-dev" 1091 | } 1092 | }, 1093 | "autoload": { 1094 | "classmap": [ 1095 | "src/" 1096 | ] 1097 | }, 1098 | "notification-url": "https://packagist.org/downloads/", 1099 | "license": [ 1100 | "BSD-3-Clause" 1101 | ], 1102 | "authors": [ 1103 | { 1104 | "name": "Sebastian Bergmann", 1105 | "email": "sebastian@phpunit.de" 1106 | }, 1107 | { 1108 | "name": "Jeff Welch", 1109 | "email": "whatthejeff@gmail.com" 1110 | }, 1111 | { 1112 | "name": "Volker Dusch", 1113 | "email": "github@wallbash.com" 1114 | }, 1115 | { 1116 | "name": "Bernhard Schussek", 1117 | "email": "bschussek@2bepublished.at" 1118 | } 1119 | ], 1120 | "description": "Provides the functionality to compare PHP values for equality", 1121 | "homepage": "https://github.com/sebastianbergmann/comparator", 1122 | "keywords": [ 1123 | "comparator", 1124 | "compare", 1125 | "equality" 1126 | ], 1127 | "support": { 1128 | "issues": "https://github.com/sebastianbergmann/comparator/issues", 1129 | "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.8" 1130 | }, 1131 | "funding": [ 1132 | { 1133 | "url": "https://github.com/sebastianbergmann", 1134 | "type": "github" 1135 | } 1136 | ], 1137 | "time": "2022-09-14T12:41:17+00:00" 1138 | }, 1139 | { 1140 | "name": "sebastian/complexity", 1141 | "version": "2.0.2", 1142 | "source": { 1143 | "type": "git", 1144 | "url": "https://github.com/sebastianbergmann/complexity.git", 1145 | "reference": "739b35e53379900cc9ac327b2147867b8b6efd88" 1146 | }, 1147 | "dist": { 1148 | "type": "zip", 1149 | "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/739b35e53379900cc9ac327b2147867b8b6efd88", 1150 | "reference": "739b35e53379900cc9ac327b2147867b8b6efd88", 1151 | "shasum": "" 1152 | }, 1153 | "require": { 1154 | "nikic/php-parser": "^4.7", 1155 | "php": ">=7.3" 1156 | }, 1157 | "require-dev": { 1158 | "phpunit/phpunit": "^9.3" 1159 | }, 1160 | "type": "library", 1161 | "extra": { 1162 | "branch-alias": { 1163 | "dev-master": "2.0-dev" 1164 | } 1165 | }, 1166 | "autoload": { 1167 | "classmap": [ 1168 | "src/" 1169 | ] 1170 | }, 1171 | "notification-url": "https://packagist.org/downloads/", 1172 | "license": [ 1173 | "BSD-3-Clause" 1174 | ], 1175 | "authors": [ 1176 | { 1177 | "name": "Sebastian Bergmann", 1178 | "email": "sebastian@phpunit.de", 1179 | "role": "lead" 1180 | } 1181 | ], 1182 | "description": "Library for calculating the complexity of PHP code units", 1183 | "homepage": "https://github.com/sebastianbergmann/complexity", 1184 | "support": { 1185 | "issues": "https://github.com/sebastianbergmann/complexity/issues", 1186 | "source": "https://github.com/sebastianbergmann/complexity/tree/2.0.2" 1187 | }, 1188 | "funding": [ 1189 | { 1190 | "url": "https://github.com/sebastianbergmann", 1191 | "type": "github" 1192 | } 1193 | ], 1194 | "time": "2020-10-26T15:52:27+00:00" 1195 | }, 1196 | { 1197 | "name": "sebastian/diff", 1198 | "version": "4.0.5", 1199 | "source": { 1200 | "type": "git", 1201 | "url": "https://github.com/sebastianbergmann/diff.git", 1202 | "reference": "74be17022044ebaaecfdf0c5cd504fc9cd5a7131" 1203 | }, 1204 | "dist": { 1205 | "type": "zip", 1206 | "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/74be17022044ebaaecfdf0c5cd504fc9cd5a7131", 1207 | "reference": "74be17022044ebaaecfdf0c5cd504fc9cd5a7131", 1208 | "shasum": "" 1209 | }, 1210 | "require": { 1211 | "php": ">=7.3" 1212 | }, 1213 | "require-dev": { 1214 | "phpunit/phpunit": "^9.3", 1215 | "symfony/process": "^4.2 || ^5" 1216 | }, 1217 | "type": "library", 1218 | "extra": { 1219 | "branch-alias": { 1220 | "dev-master": "4.0-dev" 1221 | } 1222 | }, 1223 | "autoload": { 1224 | "classmap": [ 1225 | "src/" 1226 | ] 1227 | }, 1228 | "notification-url": "https://packagist.org/downloads/", 1229 | "license": [ 1230 | "BSD-3-Clause" 1231 | ], 1232 | "authors": [ 1233 | { 1234 | "name": "Sebastian Bergmann", 1235 | "email": "sebastian@phpunit.de" 1236 | }, 1237 | { 1238 | "name": "Kore Nordmann", 1239 | "email": "mail@kore-nordmann.de" 1240 | } 1241 | ], 1242 | "description": "Diff implementation", 1243 | "homepage": "https://github.com/sebastianbergmann/diff", 1244 | "keywords": [ 1245 | "diff", 1246 | "udiff", 1247 | "unidiff", 1248 | "unified diff" 1249 | ], 1250 | "support": { 1251 | "issues": "https://github.com/sebastianbergmann/diff/issues", 1252 | "source": "https://github.com/sebastianbergmann/diff/tree/4.0.5" 1253 | }, 1254 | "funding": [ 1255 | { 1256 | "url": "https://github.com/sebastianbergmann", 1257 | "type": "github" 1258 | } 1259 | ], 1260 | "time": "2023-05-07T05:35:17+00:00" 1261 | }, 1262 | { 1263 | "name": "sebastian/environment", 1264 | "version": "5.1.5", 1265 | "source": { 1266 | "type": "git", 1267 | "url": "https://github.com/sebastianbergmann/environment.git", 1268 | "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed" 1269 | }, 1270 | "dist": { 1271 | "type": "zip", 1272 | "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", 1273 | "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", 1274 | "shasum": "" 1275 | }, 1276 | "require": { 1277 | "php": ">=7.3" 1278 | }, 1279 | "require-dev": { 1280 | "phpunit/phpunit": "^9.3" 1281 | }, 1282 | "suggest": { 1283 | "ext-posix": "*" 1284 | }, 1285 | "type": "library", 1286 | "extra": { 1287 | "branch-alias": { 1288 | "dev-master": "5.1-dev" 1289 | } 1290 | }, 1291 | "autoload": { 1292 | "classmap": [ 1293 | "src/" 1294 | ] 1295 | }, 1296 | "notification-url": "https://packagist.org/downloads/", 1297 | "license": [ 1298 | "BSD-3-Clause" 1299 | ], 1300 | "authors": [ 1301 | { 1302 | "name": "Sebastian Bergmann", 1303 | "email": "sebastian@phpunit.de" 1304 | } 1305 | ], 1306 | "description": "Provides functionality to handle HHVM/PHP environments", 1307 | "homepage": "http://www.github.com/sebastianbergmann/environment", 1308 | "keywords": [ 1309 | "Xdebug", 1310 | "environment", 1311 | "hhvm" 1312 | ], 1313 | "support": { 1314 | "issues": "https://github.com/sebastianbergmann/environment/issues", 1315 | "source": "https://github.com/sebastianbergmann/environment/tree/5.1.5" 1316 | }, 1317 | "funding": [ 1318 | { 1319 | "url": "https://github.com/sebastianbergmann", 1320 | "type": "github" 1321 | } 1322 | ], 1323 | "time": "2023-02-03T06:03:51+00:00" 1324 | }, 1325 | { 1326 | "name": "sebastian/exporter", 1327 | "version": "4.0.5", 1328 | "source": { 1329 | "type": "git", 1330 | "url": "https://github.com/sebastianbergmann/exporter.git", 1331 | "reference": "ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d" 1332 | }, 1333 | "dist": { 1334 | "type": "zip", 1335 | "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d", 1336 | "reference": "ac230ed27f0f98f597c8a2b6eb7ac563af5e5b9d", 1337 | "shasum": "" 1338 | }, 1339 | "require": { 1340 | "php": ">=7.3", 1341 | "sebastian/recursion-context": "^4.0" 1342 | }, 1343 | "require-dev": { 1344 | "ext-mbstring": "*", 1345 | "phpunit/phpunit": "^9.3" 1346 | }, 1347 | "type": "library", 1348 | "extra": { 1349 | "branch-alias": { 1350 | "dev-master": "4.0-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 | "name": "Jeff Welch", 1369 | "email": "whatthejeff@gmail.com" 1370 | }, 1371 | { 1372 | "name": "Volker Dusch", 1373 | "email": "github@wallbash.com" 1374 | }, 1375 | { 1376 | "name": "Adam Harvey", 1377 | "email": "aharvey@php.net" 1378 | }, 1379 | { 1380 | "name": "Bernhard Schussek", 1381 | "email": "bschussek@gmail.com" 1382 | } 1383 | ], 1384 | "description": "Provides the functionality to export PHP variables for visualization", 1385 | "homepage": "https://www.github.com/sebastianbergmann/exporter", 1386 | "keywords": [ 1387 | "export", 1388 | "exporter" 1389 | ], 1390 | "support": { 1391 | "issues": "https://github.com/sebastianbergmann/exporter/issues", 1392 | "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.5" 1393 | }, 1394 | "funding": [ 1395 | { 1396 | "url": "https://github.com/sebastianbergmann", 1397 | "type": "github" 1398 | } 1399 | ], 1400 | "time": "2022-09-14T06:03:37+00:00" 1401 | }, 1402 | { 1403 | "name": "sebastian/global-state", 1404 | "version": "5.0.5", 1405 | "source": { 1406 | "type": "git", 1407 | "url": "https://github.com/sebastianbergmann/global-state.git", 1408 | "reference": "0ca8db5a5fc9c8646244e629625ac486fa286bf2" 1409 | }, 1410 | "dist": { 1411 | "type": "zip", 1412 | "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/0ca8db5a5fc9c8646244e629625ac486fa286bf2", 1413 | "reference": "0ca8db5a5fc9c8646244e629625ac486fa286bf2", 1414 | "shasum": "" 1415 | }, 1416 | "require": { 1417 | "php": ">=7.3", 1418 | "sebastian/object-reflector": "^2.0", 1419 | "sebastian/recursion-context": "^4.0" 1420 | }, 1421 | "require-dev": { 1422 | "ext-dom": "*", 1423 | "phpunit/phpunit": "^9.3" 1424 | }, 1425 | "suggest": { 1426 | "ext-uopz": "*" 1427 | }, 1428 | "type": "library", 1429 | "extra": { 1430 | "branch-alias": { 1431 | "dev-master": "5.0-dev" 1432 | } 1433 | }, 1434 | "autoload": { 1435 | "classmap": [ 1436 | "src/" 1437 | ] 1438 | }, 1439 | "notification-url": "https://packagist.org/downloads/", 1440 | "license": [ 1441 | "BSD-3-Clause" 1442 | ], 1443 | "authors": [ 1444 | { 1445 | "name": "Sebastian Bergmann", 1446 | "email": "sebastian@phpunit.de" 1447 | } 1448 | ], 1449 | "description": "Snapshotting of global state", 1450 | "homepage": "http://www.github.com/sebastianbergmann/global-state", 1451 | "keywords": [ 1452 | "global state" 1453 | ], 1454 | "support": { 1455 | "issues": "https://github.com/sebastianbergmann/global-state/issues", 1456 | "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.5" 1457 | }, 1458 | "funding": [ 1459 | { 1460 | "url": "https://github.com/sebastianbergmann", 1461 | "type": "github" 1462 | } 1463 | ], 1464 | "time": "2022-02-14T08:28:10+00:00" 1465 | }, 1466 | { 1467 | "name": "sebastian/lines-of-code", 1468 | "version": "1.0.3", 1469 | "source": { 1470 | "type": "git", 1471 | "url": "https://github.com/sebastianbergmann/lines-of-code.git", 1472 | "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc" 1473 | }, 1474 | "dist": { 1475 | "type": "zip", 1476 | "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/c1c2e997aa3146983ed888ad08b15470a2e22ecc", 1477 | "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc", 1478 | "shasum": "" 1479 | }, 1480 | "require": { 1481 | "nikic/php-parser": "^4.6", 1482 | "php": ">=7.3" 1483 | }, 1484 | "require-dev": { 1485 | "phpunit/phpunit": "^9.3" 1486 | }, 1487 | "type": "library", 1488 | "extra": { 1489 | "branch-alias": { 1490 | "dev-master": "1.0-dev" 1491 | } 1492 | }, 1493 | "autoload": { 1494 | "classmap": [ 1495 | "src/" 1496 | ] 1497 | }, 1498 | "notification-url": "https://packagist.org/downloads/", 1499 | "license": [ 1500 | "BSD-3-Clause" 1501 | ], 1502 | "authors": [ 1503 | { 1504 | "name": "Sebastian Bergmann", 1505 | "email": "sebastian@phpunit.de", 1506 | "role": "lead" 1507 | } 1508 | ], 1509 | "description": "Library for counting the lines of code in PHP source code", 1510 | "homepage": "https://github.com/sebastianbergmann/lines-of-code", 1511 | "support": { 1512 | "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", 1513 | "source": "https://github.com/sebastianbergmann/lines-of-code/tree/1.0.3" 1514 | }, 1515 | "funding": [ 1516 | { 1517 | "url": "https://github.com/sebastianbergmann", 1518 | "type": "github" 1519 | } 1520 | ], 1521 | "time": "2020-11-28T06:42:11+00:00" 1522 | }, 1523 | { 1524 | "name": "sebastian/object-enumerator", 1525 | "version": "4.0.4", 1526 | "source": { 1527 | "type": "git", 1528 | "url": "https://github.com/sebastianbergmann/object-enumerator.git", 1529 | "reference": "5c9eeac41b290a3712d88851518825ad78f45c71" 1530 | }, 1531 | "dist": { 1532 | "type": "zip", 1533 | "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/5c9eeac41b290a3712d88851518825ad78f45c71", 1534 | "reference": "5c9eeac41b290a3712d88851518825ad78f45c71", 1535 | "shasum": "" 1536 | }, 1537 | "require": { 1538 | "php": ">=7.3", 1539 | "sebastian/object-reflector": "^2.0", 1540 | "sebastian/recursion-context": "^4.0" 1541 | }, 1542 | "require-dev": { 1543 | "phpunit/phpunit": "^9.3" 1544 | }, 1545 | "type": "library", 1546 | "extra": { 1547 | "branch-alias": { 1548 | "dev-master": "4.0-dev" 1549 | } 1550 | }, 1551 | "autoload": { 1552 | "classmap": [ 1553 | "src/" 1554 | ] 1555 | }, 1556 | "notification-url": "https://packagist.org/downloads/", 1557 | "license": [ 1558 | "BSD-3-Clause" 1559 | ], 1560 | "authors": [ 1561 | { 1562 | "name": "Sebastian Bergmann", 1563 | "email": "sebastian@phpunit.de" 1564 | } 1565 | ], 1566 | "description": "Traverses array structures and object graphs to enumerate all referenced objects", 1567 | "homepage": "https://github.com/sebastianbergmann/object-enumerator/", 1568 | "support": { 1569 | "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", 1570 | "source": "https://github.com/sebastianbergmann/object-enumerator/tree/4.0.4" 1571 | }, 1572 | "funding": [ 1573 | { 1574 | "url": "https://github.com/sebastianbergmann", 1575 | "type": "github" 1576 | } 1577 | ], 1578 | "time": "2020-10-26T13:12:34+00:00" 1579 | }, 1580 | { 1581 | "name": "sebastian/object-reflector", 1582 | "version": "2.0.4", 1583 | "source": { 1584 | "type": "git", 1585 | "url": "https://github.com/sebastianbergmann/object-reflector.git", 1586 | "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7" 1587 | }, 1588 | "dist": { 1589 | "type": "zip", 1590 | "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", 1591 | "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", 1592 | "shasum": "" 1593 | }, 1594 | "require": { 1595 | "php": ">=7.3" 1596 | }, 1597 | "require-dev": { 1598 | "phpunit/phpunit": "^9.3" 1599 | }, 1600 | "type": "library", 1601 | "extra": { 1602 | "branch-alias": { 1603 | "dev-master": "2.0-dev" 1604 | } 1605 | }, 1606 | "autoload": { 1607 | "classmap": [ 1608 | "src/" 1609 | ] 1610 | }, 1611 | "notification-url": "https://packagist.org/downloads/", 1612 | "license": [ 1613 | "BSD-3-Clause" 1614 | ], 1615 | "authors": [ 1616 | { 1617 | "name": "Sebastian Bergmann", 1618 | "email": "sebastian@phpunit.de" 1619 | } 1620 | ], 1621 | "description": "Allows reflection of object attributes, including inherited and non-public ones", 1622 | "homepage": "https://github.com/sebastianbergmann/object-reflector/", 1623 | "support": { 1624 | "issues": "https://github.com/sebastianbergmann/object-reflector/issues", 1625 | "source": "https://github.com/sebastianbergmann/object-reflector/tree/2.0.4" 1626 | }, 1627 | "funding": [ 1628 | { 1629 | "url": "https://github.com/sebastianbergmann", 1630 | "type": "github" 1631 | } 1632 | ], 1633 | "time": "2020-10-26T13:14:26+00:00" 1634 | }, 1635 | { 1636 | "name": "sebastian/recursion-context", 1637 | "version": "4.0.5", 1638 | "source": { 1639 | "type": "git", 1640 | "url": "https://github.com/sebastianbergmann/recursion-context.git", 1641 | "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1" 1642 | }, 1643 | "dist": { 1644 | "type": "zip", 1645 | "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", 1646 | "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", 1647 | "shasum": "" 1648 | }, 1649 | "require": { 1650 | "php": ">=7.3" 1651 | }, 1652 | "require-dev": { 1653 | "phpunit/phpunit": "^9.3" 1654 | }, 1655 | "type": "library", 1656 | "extra": { 1657 | "branch-alias": { 1658 | "dev-master": "4.0-dev" 1659 | } 1660 | }, 1661 | "autoload": { 1662 | "classmap": [ 1663 | "src/" 1664 | ] 1665 | }, 1666 | "notification-url": "https://packagist.org/downloads/", 1667 | "license": [ 1668 | "BSD-3-Clause" 1669 | ], 1670 | "authors": [ 1671 | { 1672 | "name": "Sebastian Bergmann", 1673 | "email": "sebastian@phpunit.de" 1674 | }, 1675 | { 1676 | "name": "Jeff Welch", 1677 | "email": "whatthejeff@gmail.com" 1678 | }, 1679 | { 1680 | "name": "Adam Harvey", 1681 | "email": "aharvey@php.net" 1682 | } 1683 | ], 1684 | "description": "Provides functionality to recursively process PHP variables", 1685 | "homepage": "https://github.com/sebastianbergmann/recursion-context", 1686 | "support": { 1687 | "issues": "https://github.com/sebastianbergmann/recursion-context/issues", 1688 | "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.5" 1689 | }, 1690 | "funding": [ 1691 | { 1692 | "url": "https://github.com/sebastianbergmann", 1693 | "type": "github" 1694 | } 1695 | ], 1696 | "time": "2023-02-03T06:07:39+00:00" 1697 | }, 1698 | { 1699 | "name": "sebastian/resource-operations", 1700 | "version": "3.0.3", 1701 | "source": { 1702 | "type": "git", 1703 | "url": "https://github.com/sebastianbergmann/resource-operations.git", 1704 | "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8" 1705 | }, 1706 | "dist": { 1707 | "type": "zip", 1708 | "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", 1709 | "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8", 1710 | "shasum": "" 1711 | }, 1712 | "require": { 1713 | "php": ">=7.3" 1714 | }, 1715 | "require-dev": { 1716 | "phpunit/phpunit": "^9.0" 1717 | }, 1718 | "type": "library", 1719 | "extra": { 1720 | "branch-alias": { 1721 | "dev-master": "3.0-dev" 1722 | } 1723 | }, 1724 | "autoload": { 1725 | "classmap": [ 1726 | "src/" 1727 | ] 1728 | }, 1729 | "notification-url": "https://packagist.org/downloads/", 1730 | "license": [ 1731 | "BSD-3-Clause" 1732 | ], 1733 | "authors": [ 1734 | { 1735 | "name": "Sebastian Bergmann", 1736 | "email": "sebastian@phpunit.de" 1737 | } 1738 | ], 1739 | "description": "Provides a list of PHP built-in functions that operate on resources", 1740 | "homepage": "https://www.github.com/sebastianbergmann/resource-operations", 1741 | "support": { 1742 | "issues": "https://github.com/sebastianbergmann/resource-operations/issues", 1743 | "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.3" 1744 | }, 1745 | "funding": [ 1746 | { 1747 | "url": "https://github.com/sebastianbergmann", 1748 | "type": "github" 1749 | } 1750 | ], 1751 | "time": "2020-09-28T06:45:17+00:00" 1752 | }, 1753 | { 1754 | "name": "sebastian/type", 1755 | "version": "3.2.1", 1756 | "source": { 1757 | "type": "git", 1758 | "url": "https://github.com/sebastianbergmann/type.git", 1759 | "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7" 1760 | }, 1761 | "dist": { 1762 | "type": "zip", 1763 | "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", 1764 | "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", 1765 | "shasum": "" 1766 | }, 1767 | "require": { 1768 | "php": ">=7.3" 1769 | }, 1770 | "require-dev": { 1771 | "phpunit/phpunit": "^9.5" 1772 | }, 1773 | "type": "library", 1774 | "extra": { 1775 | "branch-alias": { 1776 | "dev-master": "3.2-dev" 1777 | } 1778 | }, 1779 | "autoload": { 1780 | "classmap": [ 1781 | "src/" 1782 | ] 1783 | }, 1784 | "notification-url": "https://packagist.org/downloads/", 1785 | "license": [ 1786 | "BSD-3-Clause" 1787 | ], 1788 | "authors": [ 1789 | { 1790 | "name": "Sebastian Bergmann", 1791 | "email": "sebastian@phpunit.de", 1792 | "role": "lead" 1793 | } 1794 | ], 1795 | "description": "Collection of value objects that represent the types of the PHP type system", 1796 | "homepage": "https://github.com/sebastianbergmann/type", 1797 | "support": { 1798 | "issues": "https://github.com/sebastianbergmann/type/issues", 1799 | "source": "https://github.com/sebastianbergmann/type/tree/3.2.1" 1800 | }, 1801 | "funding": [ 1802 | { 1803 | "url": "https://github.com/sebastianbergmann", 1804 | "type": "github" 1805 | } 1806 | ], 1807 | "time": "2023-02-03T06:13:03+00:00" 1808 | }, 1809 | { 1810 | "name": "sebastian/version", 1811 | "version": "3.0.2", 1812 | "source": { 1813 | "type": "git", 1814 | "url": "https://github.com/sebastianbergmann/version.git", 1815 | "reference": "c6c1022351a901512170118436c764e473f6de8c" 1816 | }, 1817 | "dist": { 1818 | "type": "zip", 1819 | "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c6c1022351a901512170118436c764e473f6de8c", 1820 | "reference": "c6c1022351a901512170118436c764e473f6de8c", 1821 | "shasum": "" 1822 | }, 1823 | "require": { 1824 | "php": ">=7.3" 1825 | }, 1826 | "type": "library", 1827 | "extra": { 1828 | "branch-alias": { 1829 | "dev-master": "3.0-dev" 1830 | } 1831 | }, 1832 | "autoload": { 1833 | "classmap": [ 1834 | "src/" 1835 | ] 1836 | }, 1837 | "notification-url": "https://packagist.org/downloads/", 1838 | "license": [ 1839 | "BSD-3-Clause" 1840 | ], 1841 | "authors": [ 1842 | { 1843 | "name": "Sebastian Bergmann", 1844 | "email": "sebastian@phpunit.de", 1845 | "role": "lead" 1846 | } 1847 | ], 1848 | "description": "Library that helps with managing the version number of Git-hosted PHP projects", 1849 | "homepage": "https://github.com/sebastianbergmann/version", 1850 | "support": { 1851 | "issues": "https://github.com/sebastianbergmann/version/issues", 1852 | "source": "https://github.com/sebastianbergmann/version/tree/3.0.2" 1853 | }, 1854 | "funding": [ 1855 | { 1856 | "url": "https://github.com/sebastianbergmann", 1857 | "type": "github" 1858 | } 1859 | ], 1860 | "time": "2020-09-28T06:39:44+00:00" 1861 | }, 1862 | { 1863 | "name": "theseer/tokenizer", 1864 | "version": "1.2.1", 1865 | "source": { 1866 | "type": "git", 1867 | "url": "https://github.com/theseer/tokenizer.git", 1868 | "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e" 1869 | }, 1870 | "dist": { 1871 | "type": "zip", 1872 | "url": "https://api.github.com/repos/theseer/tokenizer/zipball/34a41e998c2183e22995f158c581e7b5e755ab9e", 1873 | "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e", 1874 | "shasum": "" 1875 | }, 1876 | "require": { 1877 | "ext-dom": "*", 1878 | "ext-tokenizer": "*", 1879 | "ext-xmlwriter": "*", 1880 | "php": "^7.2 || ^8.0" 1881 | }, 1882 | "type": "library", 1883 | "autoload": { 1884 | "classmap": [ 1885 | "src/" 1886 | ] 1887 | }, 1888 | "notification-url": "https://packagist.org/downloads/", 1889 | "license": [ 1890 | "BSD-3-Clause" 1891 | ], 1892 | "authors": [ 1893 | { 1894 | "name": "Arne Blankerts", 1895 | "email": "arne@blankerts.de", 1896 | "role": "Developer" 1897 | } 1898 | ], 1899 | "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", 1900 | "support": { 1901 | "issues": "https://github.com/theseer/tokenizer/issues", 1902 | "source": "https://github.com/theseer/tokenizer/tree/1.2.1" 1903 | }, 1904 | "funding": [ 1905 | { 1906 | "url": "https://github.com/theseer", 1907 | "type": "github" 1908 | } 1909 | ], 1910 | "time": "2021-07-28T10:34:58+00:00" 1911 | } 1912 | ], 1913 | "aliases": [], 1914 | "minimum-stability": "stable", 1915 | "stability-flags": [], 1916 | "prefer-stable": false, 1917 | "prefer-lowest": false, 1918 | "platform": { 1919 | "php": ">=8.0", 1920 | "ext-mbstring": "*" 1921 | }, 1922 | "platform-dev": [], 1923 | "plugin-api-version": "2.3.0" 1924 | } 1925 | -------------------------------------------------------------------------------- /docker/php80/Dockerfile: -------------------------------------------------------------------------------- 1 | # Start from PHP 8.0 CLI image 2 | FROM php:8.0-cli 3 | 4 | # Install system dependencies 5 | RUN apt-get update && apt-get install -y \ 6 | git \ 7 | unzip 8 | 9 | # Install Composer 10 | COPY --from=composer:latest /usr/bin/composer /usr/bin/composer 11 | 12 | # Set working directory 13 | WORKDIR /app 14 | -------------------------------------------------------------------------------- /docker/php81/Dockerfile: -------------------------------------------------------------------------------- 1 | # Start from PHP 8.1 CLI image 2 | FROM php:8.1-cli 3 | 4 | # Install system dependencies 5 | RUN apt-get update && apt-get install -y \ 6 | git \ 7 | unzip 8 | 9 | # Install Composer 10 | COPY --from=composer:latest /usr/bin/composer /usr/bin/composer 11 | 12 | # Set working directory 13 | WORKDIR /app 14 | -------------------------------------------------------------------------------- /docker/php82/Dockerfile: -------------------------------------------------------------------------------- 1 | # Start from PHP 8.2 CLI image 2 | FROM php:8.2-cli 3 | 4 | # Install system dependencies 5 | RUN apt-get update && apt-get install -y \ 6 | git \ 7 | unzip 8 | 9 | # Install Composer 10 | COPY --from=composer:latest /usr/bin/composer /usr/bin/composer 11 | 12 | # Set working directory 13 | WORKDIR /app 14 | -------------------------------------------------------------------------------- /docs/blade.md: -------------------------------------------------------------------------------- 1 | # comment pattern for blade template 2 | 3 | ## Usage 4 | 5 | ```html 6 | {{-- php-del start flag --}} 7 |

This section will be deleted.

8 | {{-- php-del end flag --}} 9 | ``` 10 | 11 | ## Line delete 12 | 13 | ```html 14 |

This section will be deleted.

{{-- php-del line flag --}} 15 | ``` 16 | 17 | ## Codes not covered 18 | 19 | ```html 20 | {{-- php-del start flag --}} 21 |

This section will be deleted.

22 | {{-- php-del ignore start --}} 23 |

This area will not be deleted.

24 | {{-- php-del ignore end --}} 25 | {{-- php-del end flag --}} 26 | ``` 27 | 28 | ## File delete 29 | 30 | ```html 31 | {{-- php-del file flag --}} 32 | ``` 33 | -------------------------------------------------------------------------------- /docs/css_and_alt_css.md: -------------------------------------------------------------------------------- 1 | # comment pattern for CSS or AltCSS 2 | 3 | ## Configuration 4 | Create php-del.json in the root directory of the project 5 | 6 | ```json 7 | { 8 | "dirs": [ 9 | "src" 10 | ], 11 | "extensions": [ 12 | "php", 13 | "css", 14 | "sass", 15 | "scss", 16 | "stylus" 17 | ] 18 | } 19 | ``` 20 | 21 | ## Usage 22 | 23 | for CSS 24 | ```css 25 | /* php-del start flag */ 26 | .delete { 27 | display: none; 28 | } 29 | /* php-del end flag */ 30 | ``` 31 | 32 | for Alt CSS 33 | ```scss 34 | // php-del start flag 35 | .delete { 36 | display: none; 37 | } 38 | // php-del end flag 39 | ``` 40 | 41 | ## Line delete 42 | 43 | for CSS 44 | ```css 45 | .delete { 46 | display: none; /** php-del line flag */ 47 | color: red; 48 | } 49 | ``` 50 | 51 | for Alt CSS 52 | ```scss 53 | .delete { 54 | display: none; // php-del line flag 55 | color: red; 56 | } 57 | ``` 58 | 59 | ## Codes not covered 60 | 61 | for CSS 62 | ```html 63 | .delete { 64 | /* php-del start flag */ 65 | display: none; 66 | /* php-del ignore start */ 67 | color: red; 68 | /* php-del ignore end */ 69 | /* php-del end flag */ 70 | } 71 | ``` 72 | 73 | for Alt CSS 74 | ```scss 75 | .delete { 76 | // php-del start flag 77 | display: none; 78 | // php-del ignore start 79 | color: red; 80 | // php-del ignore end 81 | // php-del end flag 82 | } 83 | ``` 84 | 85 | ## File delete 86 | 87 | for CSS 88 | ```css 89 | /* php-del file flag */ 90 | ``` 91 | 92 | for Alt CSS 93 | ```scss 94 | // php-del file flag 95 | ``` -------------------------------------------------------------------------------- /php-del: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env php 2 | main(); 30 | -------------------------------------------------------------------------------- /php-del.json: -------------------------------------------------------------------------------- 1 | { 2 | "dirs": [ 3 | "tests/actual" 4 | ], 5 | "extensions": [ 6 | "php" 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | ./src 8 | 9 | 10 | 11 | 12 | ./tests/Unit 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/Application.php: -------------------------------------------------------------------------------- 1 | cli = $cli; 17 | $this->initCli(); 18 | } 19 | 20 | private function initCli(): void 21 | { 22 | $this->cli->arguments->add([ 23 | 'dry-run' => [ 24 | 'longPrefix' => 'dry-run', 25 | 'description' => 'Make it work without executing delete', 26 | 'noValue' => true, 27 | ], 28 | 'help' => [ 29 | 'longPrefix' => 'help', 30 | 'description' => 'Prints a usage statement', 31 | 'noValue' => true, 32 | ], 33 | ]); 34 | $this->cli->arguments->parse(); 35 | } 36 | 37 | private function help(): bool 38 | { 39 | return (bool) $this->cli->arguments->get('help'); 40 | } 41 | 42 | private function isDryRun(): bool 43 | { 44 | return (bool) $this->cli->arguments->get('dry-run'); 45 | } 46 | 47 | public function main(): void 48 | { 49 | if ($this->help()) { 50 | $this->cli->usage(); 51 | return; 52 | } 53 | $config = ConfigFactory::make(); 54 | $this->cli->blink()->dim('Finding flag...'); 55 | $finder = new Finder($config); 56 | $finder->findFlag(); 57 | $flagList = $finder->getFlagList(); 58 | if ($flagList->empty()) { 59 | $this->cli->backgroundYellow()->out("Nothing flag."); 60 | return; 61 | } 62 | $input = $this->cli->radio('Please choice me one of the following flag:', (array)$finder->getFlagList()); 63 | $deleteFlag = $input->prompt(); 64 | foreach ($finder->getTargetFileList() as $file) { 65 | try { 66 | $text = file_get_contents($file); 67 | if ($this->deleteFileWhenHasFlag($file, $text, $deleteFlag)) { 68 | $this->cli->backgroundGreen($file . "(delete)"); 69 | continue; 70 | } 71 | $rewriter = new Rewriter($text); 72 | $commentPattern = (new CommentPatternProvider($file))->get($deleteFlag); 73 | $text = $rewriter->exec($commentPattern); 74 | if ($rewriter->count() === 0) { 75 | continue; 76 | } 77 | if (!$this->isDryRun()) { 78 | $result = file_put_contents($file, $text); 79 | if ($result === false) { 80 | throw new \RuntimeException("File Put Contents Error."); 81 | } 82 | } 83 | $this->cli->backgroundGreen($file . "({$rewriter->count()})"); 84 | } catch (\Throwable $throwable) { 85 | $this->cli->backgroundRed($file); 86 | $this->cli->error("[ERROR] " . $throwable->getMessage()); 87 | } 88 | } 89 | $this->cli->out("End php-del"); 90 | } 91 | 92 | private function deleteFileWhenHasFlag(string $file, string $text, string $deleteFlag): bool 93 | { 94 | $deleter = new Deleter($text); 95 | if (!$deleter->isDelete($deleteFlag)) { 96 | return false; 97 | } 98 | $result = unlink($file); 99 | if ($result) { 100 | return true; 101 | } 102 | throw new \RuntimeException("Unlink Failed."); 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /src/Comment/Comment.php: -------------------------------------------------------------------------------- 1 | target = $target; 19 | $this->commentPattern = $commentPattern; 20 | } 21 | 22 | public function notfound(): bool 23 | { 24 | return ! $this->found; 25 | } 26 | 27 | public function targetCode(): string 28 | { 29 | return mb_substr($this->target, $this->startPosition, $this->endPosition - $this->startPosition); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/Comment/CommentPatternProvider.php: -------------------------------------------------------------------------------- 1 | filePath = $filePath; 20 | } 21 | 22 | private function ext(): string 23 | { 24 | $extArray = array_reverse(explode(".", $this->filePath)); 25 | if ($extArray[0] === 'php' && $extArray[1] === 'blade') { 26 | return 'blade.php'; 27 | } 28 | return $extArray[0]; 29 | } 30 | 31 | public function get(string $flag): CommentPattern 32 | { 33 | switch ($this->ext()) { 34 | case 'php': 35 | return new RawPhpPattern($flag); 36 | case 'blade.php': 37 | return new BladePhpPattern($flag); 38 | case 'css': 39 | return new CssPattern($flag); 40 | case 'sass': 41 | case 'scss': 42 | case 'stylus': 43 | return new AltCssPattern($flag); 44 | } 45 | throw new UndefinedExtensionException($this->ext() . ' is undefined extension.'); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/Comment/DeleteComment.php: -------------------------------------------------------------------------------- 1 | commentPattern->startMatchPatternAtDelete(); 11 | } 12 | 13 | protected function matchEndPattern(): string 14 | { 15 | return $this->commentPattern->endMatchPatternAtDelete(); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Comment/IgnoreComment.php: -------------------------------------------------------------------------------- 1 | commentPattern->startMatchPatternAtIgnore(); 11 | } 12 | 13 | protected function matchEndPattern(): string 14 | { 15 | return $this->commentPattern->endMatchPatternAtIgnore(); 16 | } 17 | 18 | private function startPositionWithCode(): int 19 | { 20 | return (int) mb_strpos($this->targetCode(), $this->startPhrase) + mb_strlen($this->startPhrase); 21 | } 22 | 23 | private function endPositionWithCode(): int 24 | { 25 | $erasedEnd = mb_strstr($this->targetCode(), $this->endPhrase, true); 26 | $eol = mb_strrpos($erasedEnd, PHP_EOL); 27 | return $eol === false ? mb_strlen($erasedEnd) : $eol; 28 | } 29 | 30 | public function ignoreCode(): string 31 | { 32 | return mb_substr( 33 | $this->targetCode(), 34 | $this->startPositionWithCode(), 35 | $this->endPositionWithCode() - $this->startPositionWithCode() 36 | ); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/Comment/LineComment.php: -------------------------------------------------------------------------------- 1 | init(); 16 | } 17 | 18 | private function matchPattern(): string 19 | { 20 | return $this->commentPattern->matchPatternAtLine(); 21 | } 22 | 23 | private function init(): void 24 | { 25 | $matches = []; 26 | $result = preg_match($this->matchPattern(), $this->target, $matches, PREG_OFFSET_CAPTURE); 27 | if ($result === 1) { 28 | $this->found = true; 29 | $this->phrase = $matches[0][0]; 30 | $this->setStartPosition(); 31 | $this->setEndPosition(); 32 | } 33 | } 34 | 35 | private function setStartPosition(): void 36 | { 37 | $this->startPosition = (int) mb_strrpos(mb_strstr($this->target, $this->phrase, true), PHP_EOL); 38 | } 39 | 40 | private function setEndPosition(): void 41 | { 42 | $this->endPosition = (int) mb_strpos($this->target, $this->phrase) + mb_strlen($this->phrase); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/Comment/Pattern/AltCssPattern.php: -------------------------------------------------------------------------------- 1 | flag}+((|\*|\n|\s)*.\/|))|(\/\/(\*|\s)*+php-del\s+start\s+{$this->flag}+(|\s)*)/iu"; 11 | } 12 | 13 | public function endMatchPatternAtDelete(): string 14 | { 15 | return "/(\/\*(\*|\n|\s)*+php-del\s+end\s+{$this->flag}+((|\*|\s)*.\/|))|(\/\/\s*+php-del\s+end\s+{$this->flag}+(|\s)*)/iu"; 16 | } 17 | 18 | public function startMatchPatternAtIgnore(): string 19 | { 20 | return "/(\/\*(\*|\n|\s)*+php-del\s+ignore\s+start+((|\*|\n|\s)*.\/|))|(\/\/(\*|\s)*+php-del\s+ignore\s+start+(|\s)*)/iu"; 21 | } 22 | 23 | public function endMatchPatternAtIgnore(): string 24 | { 25 | return "/(\/\*(\*|\n|\s)*+php-del\s+ignore\s+end+((|\*|\n|\s)*.\/|))|(\/\/(\*|\s)*+php-del\s+ignore\s+end+(|\s)*)/iu"; 26 | } 27 | 28 | public function matchPatternAtLine(): string 29 | { 30 | return "/(\/\/|\/\*)(|\*| | |\t)*php-del( | |\t)+line( | |\t)+{$this->flag}+(.*|\s|\n$)/iu"; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/Comment/Pattern/BladePhpPattern.php: -------------------------------------------------------------------------------- 1 | flag}+((|\*|\n|\s)*.--}})/iu"; 11 | } 12 | 13 | public function endMatchPatternAtDelete(): string 14 | { 15 | return "/{{--*(\*|\n|\s)*+php-del\s+end\s+{$this->flag}+((|\*|\n|\s)*.--}})/iu"; 16 | } 17 | 18 | public function startMatchPatternAtIgnore(): string 19 | { 20 | return "/{{--*(\*|\n|\s)*+php-del\s+ignore\s+start+((|\*|\n|\s)*.--}})/iu"; 21 | } 22 | 23 | public function endMatchPatternAtIgnore(): string 24 | { 25 | return "/{{--*(\*|\n|\s)*+php-del\s+ignore\s+end+((|\*|\n|\s)*.--}})/iu"; 26 | } 27 | 28 | public function matchPatternAtLine(): string 29 | { 30 | return "/{{--*(\*|\n|\s)*+php-del\s+line\s+{$this->flag}+((|\*|\n|\s)*.--}})/iu"; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/Comment/Pattern/CommentPattern.php: -------------------------------------------------------------------------------- 1 | flag = $flag; 13 | } 14 | 15 | abstract public function startMatchPatternAtDelete(): string; 16 | abstract public function endMatchPatternAtDelete(): string; 17 | abstract public function startMatchPatternAtIgnore(): string; 18 | abstract public function endMatchPatternAtIgnore(): string; 19 | abstract public function matchPatternAtLine(): string; 20 | } 21 | -------------------------------------------------------------------------------- /src/Comment/Pattern/CssPattern.php: -------------------------------------------------------------------------------- 1 | flag}+((|\*|\n|\s)*.\/|)/iu"; 11 | } 12 | 13 | public function endMatchPatternAtDelete(): string 14 | { 15 | return "/\/\*(\n|\s)*+php-del\s+end\s+{$this->flag}+((|\*|\s)*.\/|)/iu"; 16 | } 17 | 18 | public function startMatchPatternAtIgnore(): string 19 | { 20 | return "/\/\*(\n|\s)*+php-del\s+ignore\s+start+((|\*|\n|\s)*.\/|)/iu"; 21 | } 22 | 23 | public function endMatchPatternAtIgnore(): string 24 | { 25 | return "/\/\*(\n|\s)*+php-del\s+ignore\s+end+((|\*|\n|\s)*.\/|)/iu"; 26 | } 27 | 28 | public function matchPatternAtLine(): string 29 | { 30 | return "/(\/\/|\/\*)(| | |\t)*php-del( | |\t)+line( | |\t)+{$this->flag}+(.*|\s|\n$)/iu"; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/Comment/Pattern/RawPhpPattern.php: -------------------------------------------------------------------------------- 1 | flag}+((|\*|\n|\s)*.\/|))|(\/\/(\*|\s)*+php-del\s+start\s+{$this->flag}+(|\s)*)/iu"; 11 | } 12 | 13 | public function endMatchPatternAtDelete(): string 14 | { 15 | return "/(\/\*(\*|\n|\s)*+php-del\s+end\s+{$this->flag}+((|\*|\s)*.\/|))|(\/\/\s*+php-del\s+end\s+{$this->flag}+(|\s)*)/iu"; 16 | } 17 | 18 | public function startMatchPatternAtIgnore(): string 19 | { 20 | return "/(\/\*(\*|\n|\s)*+php-del\s+ignore\s+start+((|\*|\n|\s)*.\/|))|(\/\/(\*|\s)*+php-del\s+ignore\s+start+(|\s)*)/iu"; 21 | } 22 | 23 | public function endMatchPatternAtIgnore(): string 24 | { 25 | return "/(\/\*(\*|\n|\s)*+php-del\s+ignore\s+end+((|\*|\n|\s)*.\/|))|(\/\/(\*|\s)*+php-del\s+ignore\s+end+(|\s)*)/iu"; 26 | } 27 | 28 | public function matchPatternAtLine(): string 29 | { 30 | return "/(\/\/|\/\*)(|\*| | |\t)*php-del( | |\t)+line( | |\t)+{$this->flag}+(.*|\s|\n$)/iu"; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/Comment/SandWitchComment.php: -------------------------------------------------------------------------------- 1 | setStart(); 20 | $this->setEnd(); 21 | $this->setFound(); 22 | } 23 | 24 | private function setStart(): void 25 | { 26 | $matches = []; 27 | $result = preg_match($this->matchStartPattern(), $this->target, $matches, PREG_OFFSET_CAPTURE); 28 | if ($result === 1) { 29 | $this->foundStart = true; 30 | $this->startPhrase = $matches[0][0]; 31 | $this->setStartPosition(); 32 | } 33 | } 34 | 35 | private function setEnd(): void 36 | { 37 | $matches = []; 38 | $result = preg_match($this->matchEndPattern(), $this->target, $matches, PREG_OFFSET_CAPTURE); 39 | if ($result === 1) { 40 | $this->foundEnd = true; 41 | $this->endPhrase = $matches[0][0]; 42 | $this->setEndPosition(); 43 | } 44 | } 45 | 46 | private function setFound(): void 47 | { 48 | if ($this->foundStart && !$this->foundEnd) { 49 | throw new SandWitchCommentException("There is a start comment, but no end."); 50 | } 51 | if (!$this->foundStart && $this->foundEnd) { 52 | throw new SandWitchCommentException("There is an end comment, but no start."); 53 | } 54 | $this->found = $this->foundStart && $this->foundEnd; 55 | } 56 | 57 | protected function setStartPosition(): void 58 | { 59 | $targetBefore = (string) mb_strstr($this->target, $this->startPhrase, true); 60 | // 対象コメント以前に最初に現れる改行までの位置(A) 61 | $charUpToPhpEolPosition = (int) mb_strrpos($targetBefore, PHP_EOL); 62 | // (A)からコメントまでの文字を抽出(B) 63 | $fromLettersUpToPhpEolToComments = mb_substr($this->target, $charUpToPhpEolPosition, mb_strlen($targetBefore) - $charUpToPhpEolPosition); 64 | // (B)に改行および空白文字以外が存在するかチェック 65 | $charOtherThanPhpEol = mb_strlen(trim($fromLettersUpToPhpEolToComments, " \t\n\r")); 66 | $this->startPosition = $charOtherThanPhpEol === 0 ? $charUpToPhpEolPosition : mb_strpos($this->target, $this->startPhrase); 67 | } 68 | 69 | protected function setEndPosition(): void 70 | { 71 | $this->endPosition = mb_strpos($this->target, $this->endPhrase) + mb_strlen($this->endPhrase); 72 | } 73 | 74 | abstract protected function matchStartPattern(): string; 75 | abstract protected function matchEndPattern(): string; 76 | } 77 | -------------------------------------------------------------------------------- /src/Config.php: -------------------------------------------------------------------------------- 1 | validate($config); 14 | $this->dirs = $config['dirs']; 15 | $this->extensions = $config['extensions'] ?? ['php']; 16 | } 17 | 18 | private function validate(array $config): void 19 | { 20 | if (!isset($config['dirs'])) { 21 | throw new \InvalidArgumentException(""); 22 | } 23 | } 24 | 25 | public function getDirs(): array 26 | { 27 | return $this->dirs; 28 | } 29 | 30 | public function getExtensions(): array 31 | { 32 | return $this->extensions; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/Deleter.php: -------------------------------------------------------------------------------- 1 | text = $text; 13 | } 14 | 15 | public function isDelete(string $deleteFlag):bool 16 | { 17 | $matches = []; 18 | $result = preg_match_all("/php-del+( | |\t)+file( | |\t)+{$deleteFlag}/iu", $this->text, $matches); 19 | return !($result === false || $result === 0); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/Exception/SandWitchCommentException.php: -------------------------------------------------------------------------------- 1 | config = $config; 19 | $this->setAllFileList(); 20 | } 21 | 22 | public function findFlag(): void 23 | { 24 | $flagManager = new FlagManager(); 25 | $targetFiles = []; 26 | foreach ($this->allFileList as $file) { 27 | $text = file_get_contents($file); 28 | $matches = []; 29 | $result = preg_match_all("/php-del+( | |\t)+(start|line|file)( | |\t)+(?[a-z0-9_\-=]*)/iu", $text, $matches); 30 | if ($result === false || $result === 0) { 31 | continue; 32 | } 33 | $targetFiles[] = $file; 34 | foreach ($matches['flag'] as $flag) { 35 | $flagManager->add(new Flag($flag)); 36 | } 37 | } 38 | $this->flagList = $flagManager->getFlagList(); 39 | $this->targetFileList = new TargetFileList($targetFiles); 40 | } 41 | 42 | public function getTargetFileList(): TargetFileList 43 | { 44 | return $this->targetFileList; 45 | } 46 | 47 | public function getFlagList(): FlagList 48 | { 49 | return $this->flagList; 50 | } 51 | 52 | private function setAllFileList(): void 53 | { 54 | $this->allFileList = $this->getAllFileList($this->config->getDirs()); 55 | } 56 | 57 | private function getAllFileList(array $dirs): AllFileList 58 | { 59 | $files = []; 60 | foreach ($dirs as $dir) { 61 | $files = [...$this->getFiles($dir, $this->config), ...$files]; 62 | } 63 | return new AllFileList($files); 64 | } 65 | 66 | private function getFiles(string $dir, Config $config): array 67 | { 68 | $files = []; 69 | $this->rglob(getcwd(). '/' . $dir, $config->getExtensions(), $files); 70 | return $files; 71 | } 72 | 73 | private function rglob(string $dir, array $exts, array &$results = []): void 74 | { 75 | $ls = glob($dir); 76 | if (is_array($ls)) { 77 | foreach ($ls as $item) { 78 | if (is_dir($item)) { 79 | $this->rglob($item . '/*', $exts, $results); 80 | } 81 | if (is_file($item)) { 82 | $ext = substr($item, strrpos($item, '.') + 1); 83 | if (in_array($ext, $exts, true)) { 84 | $results[] = $item; 85 | } 86 | } 87 | } 88 | } 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /src/Flag/Flag.php: -------------------------------------------------------------------------------- 1 | flag = $flag; 14 | } 15 | 16 | public function get(): string 17 | { 18 | return $this->flag; 19 | } 20 | 21 | public function count(): int 22 | { 23 | return $this->count; 24 | } 25 | 26 | public function increment(): void 27 | { 28 | ++$this->count; 29 | } 30 | 31 | public function __toString(): string 32 | { 33 | return "{$this->flag} ({$this->count})"; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/Flag/FlagList.php: -------------------------------------------------------------------------------- 1 | count() === 0; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/Flag/FlagManager.php: -------------------------------------------------------------------------------- 1 | validate($flag); 15 | if ($this->exist($flag)) { 16 | $this->get($flag)->increment(); 17 | return; 18 | } 19 | $this->hasMap[$flag->get()] = $flag; 20 | } 21 | 22 | private function get(Flag $flag): Flag 23 | { 24 | return $this->hasMap[$flag->get()]; 25 | } 26 | 27 | private function validate(Flag $flag): void 28 | { 29 | if (!$flag instanceof Flag) { 30 | throw new InvalidArgumentException("Invalid Type."); 31 | } 32 | } 33 | 34 | private function exist(Flag $flag): bool 35 | { 36 | return isset($this->hasMap[$flag->get()]); 37 | } 38 | 39 | public function getFlagList(): FlagList 40 | { 41 | return new FlagList($this->hasMap); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/Rewriter.php: -------------------------------------------------------------------------------- 1 | text = $text; 16 | } 17 | 18 | public function count(): int 19 | { 20 | return $this->count; 21 | } 22 | 23 | public function exec(CommentPattern $commentPattern): string 24 | { 25 | $text = $this->text; 26 | // multi line delete 27 | while (true) { 28 | $deleteComment = new DeleteComment($text, $commentPattern); 29 | if ($deleteComment->notfound()) { 30 | break; 31 | } 32 | $deleteCode = $deleteComment->targetCode(); 33 | 34 | $ignore = $this->ignore($deleteCode, $commentPattern); 35 | 36 | $text = str_replace($deleteCode, $ignore, $text); 37 | ++$this->count; 38 | } 39 | // single line delete 40 | while (true) { 41 | $lineComment = new LineComment($text, $commentPattern); 42 | if ($lineComment->notfound()) { 43 | break; 44 | } 45 | $deleteCode = $lineComment->targetCode(); 46 | $text = str_replace($deleteCode, '', $text); 47 | ++$this->count; 48 | } 49 | return $text; 50 | } 51 | 52 | private function ignore(string $text, CommentPattern $commentPattern): string 53 | { 54 | $ignore = ''; 55 | while (true) { 56 | /** 57 | * コメントを含む開始位置から終了位置までを検索して削除 58 | */ 59 | $ignoreComment = new IgnoreComment($text, $commentPattern); 60 | if ($ignoreComment->notfound()) { 61 | break; 62 | } 63 | $deleteCode = $ignoreComment->targetCode(); 64 | 65 | /** 66 | * ignoreコメントを除外した、ignoreしたいコードのみを抽出 67 | */ 68 | $ignore .= $ignoreComment->ignoreCode(); 69 | 70 | $text = str_replace($deleteCode, '', $text); 71 | } 72 | return $ignore; 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /tests/Unit/DeleterTest.php: -------------------------------------------------------------------------------- 1 | isDelete('delete_flag')); 11 | self::assertFalse($deleter->isDelete('not_delete_flag')); 12 | } 13 | 14 | public function testDeleterForBlade() 15 | { 16 | $text = file_get_contents(__DIR__ . '/../actual/delete_flag/delete_flag.blade.php'); 17 | $deleter = new \PHPDel\Deleter($text); 18 | self::assertTrue($deleter->isDelete('delete_flag')); 19 | self::assertFalse($deleter->isDelete('not_delete_flag')); 20 | } 21 | 22 | public function testDeleterForCss() 23 | { 24 | $text = file_get_contents(__DIR__ . '/../actual/delete_flag/delete_flag.css'); 25 | $deleter = new \PHPDel\Deleter($text); 26 | self::assertTrue($deleter->isDelete('delete_flag')); 27 | self::assertFalse($deleter->isDelete('not_delete_flag')); 28 | } 29 | 30 | public function testDeleterForAltCss() 31 | { 32 | $text = file_get_contents(__DIR__ . '/../actual/delete_flag/delete_flag.scss'); 33 | $deleter = new \PHPDel\Deleter($text); 34 | self::assertTrue($deleter->isDelete('delete_flag')); 35 | self::assertFalse($deleter->isDelete('not_delete_flag')); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /tests/Unit/FinderTest.php: -------------------------------------------------------------------------------- 1 | ['tests/actual'], 'extensions' => ['php', 'css', 'scss']]); 9 | $finder = new \PHPDel\Finder($config); 10 | $finder->findFlag(); 11 | 12 | $targetList = $finder->getTargetFileList(); 13 | self::assertEquals(13, $targetList->count()); 14 | 15 | $flagList = $finder->getFlagList(); 16 | self::assertEquals('flag_a', $flagList->offsetGet('flag_a')->get()); 17 | self::assertEquals(23, $flagList->offsetGet('flag_a')->count()); 18 | self::assertEquals('flag_a (23)', $flagList->offsetGet('flag_a')); 19 | self::assertEquals('flag_b', $flagList->offsetGet('flag_b')->get()); 20 | self::assertEquals(3, $flagList->offsetGet('flag_b')->count()); 21 | self::assertEquals('error-flag', $flagList->offsetGet('error-flag')->get()); 22 | self::assertEquals(8, $flagList->offsetGet('error-flag')->count()); 23 | self::assertEquals('delete_flag', $flagList->offsetGet('delete_flag')->get()); 24 | self::assertEquals(4, $flagList->offsetGet('delete_flag')->count()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /tests/Unit/RewriterTest.php: -------------------------------------------------------------------------------- 1 | get('flag_a'); 12 | $result = $rewriter->exec($pattern); 13 | 14 | self::assertDoesNotMatchRegularExpression('/php-del start flag_1$/', $result); 15 | self::assertDoesNotMatchRegularExpression('/php-del end flag_1$/', $result); 16 | // ignore 17 | self::assertNotFalse(strpos($result, 'd = 2;')); 18 | self::assertNotFalse(strpos($result, '$c = 3;')); 19 | 20 | // Perfect matching 21 | $expect = file_get_contents(__DIR__ . '/../expect/flag_a/FlagA.php'); 22 | self::assertEquals($expect, $result); 23 | } 24 | 25 | public function testRewriteForBlade() 26 | { 27 | $file = __DIR__ . '/../actual/flag_a/flag-a.blade.php'; 28 | $text = file_get_contents($file); 29 | $rewriter = new \PHPDel\Rewriter($text); 30 | $pattern = (new \PHPDel\Comment\CommentPatternProvider($file))->get('flag_a'); 31 | $result = $rewriter->exec($pattern); 32 | 33 | // Perfect matching 34 | $expect = file_get_contents(__DIR__ . '/../expect/flag_a/flag-a.blade.php'); 35 | self::assertEquals($expect, $result); 36 | } 37 | 38 | public function testRewriteForCSS() 39 | { 40 | $file = __DIR__ . '/../actual/flag_a/flag-a.css'; 41 | $text = file_get_contents($file); 42 | $rewriter = new \PHPDel\Rewriter($text); 43 | $pattern = (new \PHPDel\Comment\CommentPatternProvider($file))->get('flag_a'); 44 | $result = $rewriter->exec($pattern); 45 | 46 | // Perfect matching 47 | $expect = file_get_contents(__DIR__ . '/../expect/flag_a/flag-a.css'); 48 | self::assertEquals($expect, $result); 49 | } 50 | 51 | public function testRewriteForAltCSS() 52 | { 53 | $file = __DIR__ . '/../actual/flag_a/flag-a.scss'; 54 | $text = file_get_contents($file); 55 | $rewriter = new \PHPDel\Rewriter($text); 56 | $pattern = (new \PHPDel\Comment\CommentPatternProvider($file))->get('flag_a'); 57 | $result = $rewriter->exec($pattern); 58 | 59 | // Perfect matching 60 | $expect = file_get_contents(__DIR__ . '/../expect/flag_a/flag-a.scss'); 61 | self::assertEquals($expect, $result); 62 | } 63 | 64 | public function testRewriteException() 65 | { 66 | $this->expectException(\PHPDel\Exception\SandWitchCommentException::class); 67 | $file = __DIR__ . '/../actual/error_flag/ErrorFlag.php'; 68 | $text = file_get_contents($file); 69 | $rewriter = new \PHPDel\Rewriter($text); 70 | $pattern = (new \PHPDel\Comment\CommentPatternProvider($file))->get('error-flag'); 71 | $rewriter->exec($pattern); 72 | } 73 | 74 | public function testRewriteExceptionForBlade() 75 | { 76 | $this->expectException(\PHPDel\Exception\SandWitchCommentException::class); 77 | $file = __DIR__ . '/../actual/error_flag/error-flag.blade.php'; 78 | $text = file_get_contents($file); 79 | $rewriter = new \PHPDel\Rewriter($text); 80 | $pattern = (new \PHPDel\Comment\CommentPatternProvider($file))->get('error-flag'); 81 | $rewriter->exec($pattern); 82 | } 83 | 84 | public function testRewriteExceptionForCss() 85 | { 86 | $this->expectException(\PHPDel\Exception\SandWitchCommentException::class); 87 | $file = __DIR__ . '/../actual/error_flag/error-flag.css'; 88 | $text = file_get_contents($file); 89 | $rewriter = new \PHPDel\Rewriter($text); 90 | $pattern = (new \PHPDel\Comment\CommentPatternProvider($file))->get('error-flag'); 91 | $rewriter->exec($pattern); 92 | } 93 | 94 | public function testRewriteExceptionForAltCss() 95 | { 96 | $this->expectException(\PHPDel\Exception\SandWitchCommentException::class); 97 | $file = __DIR__ . '/../actual/error_flag/error-flag.scss'; 98 | $text = file_get_contents($file); 99 | $rewriter = new \PHPDel\Rewriter($text); 100 | $pattern = (new \PHPDel\Comment\CommentPatternProvider($file))->get('error-flag'); 101 | $rewriter->exec($pattern); 102 | } 103 | } 104 | -------------------------------------------------------------------------------- /tests/actual/delete_flag/DeleteFlag.php: -------------------------------------------------------------------------------- 1 | error 3 | {{-- php-del start error-flag --}} 4 | 5 | {{-- php-del end error-flag --}} 6 |

error

7 | {{-- php-del end error-flag --}} 8 | -------------------------------------------------------------------------------- /tests/actual/error_flag/error-flag.css: -------------------------------------------------------------------------------- 1 | /* php-del start error-flag */ 2 | .error { 3 | display: none; 4 | } 5 | /* php-del start error-flag */ 6 | -------------------------------------------------------------------------------- /tests/actual/error_flag/error-flag.scss: -------------------------------------------------------------------------------- 1 | // php-del start error-flag 2 | .error { 3 | display: none; 4 | } 5 | // php-del start error-flag 6 | -------------------------------------------------------------------------------- /tests/actual/flag_a/FlagA.php: -------------------------------------------------------------------------------- 1 | 'a', 52 | 'b' => /** php-del start flag_a */ true ? 'x' : /** php-del ignore start */'b'/** php-del ignore end *//** php-del end flag_a */, 53 | 'c' => 'c', 54 | ]; 55 | } 56 | 57 | public function commentNextToComment() 58 | { 59 | $a = 1; 60 | // php-del start flag_a 61 | // NOTE startに続けてコメント 62 | $b = 2; 63 | // php-del ignore start 64 | // NOTE ignore startに続けてコメント 65 | $c = 3; 66 | // php-del ignore end 67 | // NOTE ignore endに続けてコメント 68 | // php-del end flag_a 69 | // NOTE endに続けてコメント 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /tests/actual/flag_a/flag-a.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 | 8 | Document 9 | 10 | 11 | {{-- php-del start flag_a --}} 12 |

delete

13 | {{-- php-del end flag_a --}} 14 |
15 | {{-- php-del start flag_a --}} 16 |

delete

17 | {{-- php-del ignore start --}} 18 | alive 19 | {{-- php-del ignore end --}} 20 |

dead

21 | {{-- php-del end flag_a --}} 22 |
23 |

line

{{-- php-del line flag_a --}} 24 | 25 | 26 | -------------------------------------------------------------------------------- /tests/actual/flag_a/flag-a.css: -------------------------------------------------------------------------------- 1 | /* php-del start flag_a */ 2 | .test { 3 | display: none; 4 | } 5 | /* php-del end flag_a */ 6 | /* php-del start flag_a */ 7 | p { 8 | font-size: 12px; 9 | } 10 | /* php-del ignore start */ 11 | h1 { 12 | font-size: 20px; 13 | font-weight: bold; 14 | } 15 | /* php-del ignore end */ 16 | h2 { 17 | font-size: 16px; 18 | font-weight: bold; 19 | } 20 | /* php-del end flag_a */ 21 | h3 { 22 | font-size: 14px; 23 | font-weight: bold; /* php-del line flag_a */ 24 | } 25 | -------------------------------------------------------------------------------- /tests/actual/flag_a/flag-a.scss: -------------------------------------------------------------------------------- 1 | // php-del start flag_a 2 | .test { 3 | display: none; 4 | } 5 | // php-del end flag_a 6 | // php-del start flag_a 7 | p { 8 | font-size: 12px; 9 | } 10 | // php-del end flag_a 11 | body { 12 | // php-del start flag_a 13 | h1 { 14 | font-size: 20px; 15 | font-weight: bold; 16 | } 17 | // php-del ignore start 18 | h2 { 19 | font-size: 16px; 20 | font-weight: bold; 21 | } 22 | // php-del ignore end 23 | // php-del end flag_a 24 | h3 { 25 | font-size: 14px; 26 | font-weight: bold; // php-del line flag_a 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /tests/actual/flag_b/FlagB.php: -------------------------------------------------------------------------------- 1 | 'a', 25 | 'b' => 'b', 26 | 'c' => 'c', 27 | ]; 28 | } 29 | 30 | public function commentNextToComment() 31 | { 32 | $a = 1; 33 | // NOTE ignore startに続けてコメント 34 | $c = 3; 35 | // NOTE endに続けてコメント 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /tests/expect/flag_a/flag-a.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 | 8 | Document 9 | 10 | 11 |
12 | alive 13 |
14 | 15 | 16 | -------------------------------------------------------------------------------- /tests/expect/flag_a/flag-a.css: -------------------------------------------------------------------------------- 1 | 2 | h1 { 3 | font-size: 20px; 4 | font-weight: bold; 5 | } 6 | h3 { 7 | font-size: 14px; 8 | } 9 | -------------------------------------------------------------------------------- /tests/expect/flag_a/flag-a.scss: -------------------------------------------------------------------------------- 1 | 2 | body { 3 | h2 { 4 | font-size: 16px; 5 | font-weight: bold; 6 | } 7 | h3 { 8 | font-size: 14px; 9 | } 10 | } 11 | --------------------------------------------------------------------------------