diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile
new file mode 100644
index 00000000..e2b482e9
--- /dev/null
+++ b/.devcontainer/Dockerfile
@@ -0,0 +1,6 @@
+FROM debian:stable
+ARG DEBIAN_FRONTEND=noninteractive
+ARG XDEBUG_MODE=coverage
+RUN apt update -y && apt install -y git composer php-cli php-dom php-curl php-xdebug vim
+WORKDIR /app
+CMD cd /app/generator/doc && ./update.sh && cd /app/generator && composer install && php ./safe.php generate && composer cs-fix
diff --git a/.devcontainer/build.sh b/.devcontainer/build.sh
new file mode 100755
index 00000000..f7b640c0
--- /dev/null
+++ b/.devcontainer/build.sh
@@ -0,0 +1,3 @@
+#!/bin/sh
+cd $(dirname $0)/../
+docker run --rm -v ${PWD}:/app $(docker build -q -f .devcontainer/Dockerfile .)
diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json
new file mode 100644
index 00000000..26b9f0ae
--- /dev/null
+++ b/.devcontainer/devcontainer.json
@@ -0,0 +1,10 @@
+{
+ "name": "Safe PHP",
+ "build": {
+ "context": "..",
+ "dockerfile": "./Dockerfile"
+ },
+
+ "workspaceMount": "source=${localWorkspaceFolder},target=/app,type=bind",
+ "workspaceFolder": "/app"
+}
diff --git a/.devcontainer/run.sh b/.devcontainer/run.sh
new file mode 100755
index 00000000..d698c90c
--- /dev/null
+++ b/.devcontainer/run.sh
@@ -0,0 +1,3 @@
+#!/bin/sh
+cd $(dirname $0)/../
+docker run --rm -ti -v ${PWD}:/app $(docker build -q . -f .devcontainer/Dockerfile) /bin/bash
diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml
new file mode 100644
index 00000000..eb9ff542
--- /dev/null
+++ b/.github/FUNDING.yml
@@ -0,0 +1,15 @@
+# These are supported funding model platforms
+
+github: shish # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
+patreon: # Replace with a single Patreon username
+open_collective: # Replace with a single Open Collective username
+ko_fi: shish2k # Replace with a single Ko-fi username
+tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
+community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
+liberapay: # Replace with a single Liberapay username
+issuehunt: # Replace with a single IssueHunt username
+lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
+polar: # Replace with a single Polar username
+buy_me_a_coffee: # Replace with a single Buy Me a Coffee username
+thanks_dev: # Replace with a single thanks.dev username
+custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
diff --git a/.github/dependabot.yml b/.github/dependabot.yml
new file mode 100644
index 00000000..76e11428
--- /dev/null
+++ b/.github/dependabot.yml
@@ -0,0 +1,11 @@
+version: 2
+updates:
+ -
+ package-ecosystem: composer
+ directory: "/"
+ schedule:
+ interval: weekly
+ versioning-strategy: auto
+ groups:
+ dev-dependencies:
+ dependency-type: "development"
diff --git a/.github/workflows/auto-regenerate.yml b/.github/workflows/auto-regenerate.yml
index c4d4f8c0..457a9c74 100644
--- a/.github/workflows/auto-regenerate.yml
+++ b/.github/workflows/auto-regenerate.yml
@@ -4,30 +4,31 @@ name: "Auto Regenerate"
on:
schedule:
- cron: '0 3 * * *'
+ workflow_dispatch:
jobs:
auto-regenerate:
- name: "Tries to regenerate the files"
- runs-on: "ubuntu-latest"
+ name: "Auto Regenerate"
+ runs-on: "ubuntu-24.04"
steps:
- name: "Checkout"
- uses: "actions/checkout@v2"
+ uses: "actions/checkout@v4"
- name: "Install PHP with extensions"
uses: "shivammathur/setup-php@v2"
with:
coverage: "pcov"
- php-version: "8.0"
+ php-version: "8.3"
- name: "Check out salathe/phpdoc-base"
- uses: "actions/checkout@v2"
+ uses: "actions/checkout@v4"
with:
path: "generator/doc/doc-en/doc-base"
repository: "salathe/phpdoc-base"
- name: "Check out php/doc-en"
- uses: "actions/checkout@v2"
+ uses: "actions/checkout@v4"
with:
path: "generator/doc/doc-en/en"
repository: "php/doc-en"
@@ -43,33 +44,19 @@ jobs:
run: "composer dump-autoload"
- name: "Regenerate files"
- run: "./safe.php generate"
+ id: regen
+ run: "./safe.php generate && git diff --exit-code && (echo regen=no-diff >> $GITHUB_OUTPUT) || (echo regen=diff >> $GITHUB_OUTPUT)"
working-directory: "generator"
- - name: "Check if regenerated files are different"
- run: |
- if output=$(git status --porcelain) && [ -z "$output" ]; then
- # all is good
- echo "Generated files are the same as committed file: OK"
- else
- # Uncommitted changes
- echo "Generated files are different from commited files. Please run './safe.php generate' command and commit the results."
- echo "Detected changes:"
- git status
- git diff
- echo "Generated files are different from commited files. Please run './safe.php generate' command and commit the results."
- exit 1;
- fi
-
- name: "Create a pr if the files are different"
- if: ${{ failure() }}
- uses: peter-evans/create-pull-request@v3
+ if: "${{ steps.regen.outputs.regen == 'diff' }}"
+ uses: peter-evans/create-pull-request@v6
with:
commit-message: "Automatically regenerate the files"
branch: create-pull-request/regenerate-files
title: "Automatically regenerate the files"
labels: "regenerate, auto"
- assignees: "kharhamel, moufmouf"
+ assignees: "shish"
-
\ No newline at end of file
+
diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml
index 7c074738..2f138bcc 100644
--- a/.github/workflows/continuous-integration.yml
+++ b/.github/workflows/continuous-integration.yml
@@ -1,124 +1,182 @@
-# https://help.github.com/en/categories/automating-your-workflow-with-github-actions
-
-name: "Continuous Integration"
+name: "Tests"
on:
- - "pull_request"
- - "push"
+ push:
+ branches:
+ - main
+ - master
+ tags:
+ - 'v*'
+ pull_request:
jobs:
-
- continuous-integration:
- name: "Continuous Integration"
-
- runs-on: "ubuntu-latest"
-
- strategy:
- matrix:
- php-version:
- - "8.0"
-
- dependencies:
- - "highest"
-
+ fetch_defs:
+ name: "Fetch Definitions"
+ runs-on: "ubuntu-24.04"
+ outputs:
+ date: ${{ steps.date.outputs.date }}
steps:
- name: "Checkout"
- uses: "actions/checkout@v2"
-
- - name: "Install PHP with extensions"
- uses: "shivammathur/setup-php@v2"
- with:
- coverage: "pcov"
- php-version: "${{ matrix.php-version }}"
-
+ uses: "actions/checkout@v4"
- name: "Get current date for the daily cache"
id: 'date'
- run: echo "::set-output name=date::$(date +'%Y-%m-%d')"
-
+ run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
- name: "Cache the php documentation"
id: cache-php-doc
- uses: "actions/cache@v1"
+ uses: "actions/cache@v4"
with:
path: "generator/doc/doc-en"
key: php-doc-${{ steps.date.outputs.date }}
-
- name: "Check out salathe/phpdoc-base"
- uses: "actions/checkout@v2"
+ uses: "actions/checkout@v4"
if: steps.cache-php-doc.outputs.cache-hit != 'true'
with:
path: "generator/doc/doc-en/doc-base"
repository: "salathe/phpdoc-base"
-
- name: "Check out php/doc-en"
- uses: "actions/checkout@v2"
+ uses: "actions/checkout@v4"
if: steps.cache-php-doc.outputs.cache-hit != 'true'
with:
path: "generator/doc/doc-en/en"
repository: "php/doc-en"
+ generator_tests:
+ name: "Generator Tests"
+ runs-on: "ubuntu-24.04"
+ needs: "fetch_defs"
+ strategy:
+ matrix:
+ php-version:
+ - "8.2"
+ - "8.3"
+ - "8.4"
+ steps:
+ - name: "Checkout"
+ uses: "actions/checkout@v4"
+ - name: "Install PHP with extensions"
+ uses: "shivammathur/setup-php@v2"
+ with:
+ coverage: "pcov"
+ php-version: "${{ matrix.php-version }}"
+ - name: "Fetch cached docs"
+ id: cache-php-doc
+ uses: "actions/cache@v4"
+ with:
+ path: "generator/doc/doc-en"
+ key: php-doc-${{ needs.fetch_defs.outputs.date }}
- name: "Cache dependencies installed with composer"
- uses: "actions/cache@v1"
+ uses: "actions/cache@v4"
with:
path: "~/.composer/cache"
- key: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('**/composer.lock') }}"
- restore-keys: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-"
-
+ key: "php-${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.lock') }}"
+ restore-keys: "php-${{ matrix.php-version }}-composer-"
- name: "Install dependencies with composer in generator/ directory"
run: "composer install --no-interaction"
working-directory: "generator"
-
- - name: "Install dependencies with composer in root directory"
- run: "composer install --no-interaction"
-
- - name: "Run tests with phpunit/phpunit in root directory"
- run: "vendor/bin/phpunit"
-
- name: "Run tests with phpunit/phpunit in generator/ directory"
run: "vendor/bin/phpunit"
working-directory: "generator"
-
- name: "Run coding standard checks with squizlabs/php_codesniffer in generator/ directory"
run: "composer cs-check"
working-directory: "generator"
-
- name: "Run static code analysis with phpstan/phpstan in generator/ directory"
run: "composer phpstan"
working-directory: "generator"
+ - name: "Run static code analysis with rector/rector in generator/ directory"
+ run: "composer rector --dry-run"
+ working-directory: "generator"
+ generated_tests:
+ name: "Generated Tests"
+ runs-on: "ubuntu-24.04"
+ needs: "fetch_defs"
+ strategy:
+ matrix:
+ php-version:
+ - "8.2"
+ - "8.3"
+ - "8.4"
+ steps:
+ - name: "Checkout"
+ uses: "actions/checkout@v4"
+ - name: "Install PHP with extensions"
+ uses: "shivammathur/setup-php@v2"
+ with:
+ coverage: "pcov"
+ php-version: "${{ matrix.php-version }}"
+ - name: "Fetch cached docs"
+ id: cache-php-doc
+ uses: "actions/cache@v4"
+ with:
+ path: "generator/doc/doc-en"
+ key: php-doc-${{ needs.fetch_defs.outputs.date }}
+ - name: "Cache dependencies installed with composer"
+ uses: "actions/cache@v4"
+ with:
+ path: "~/.composer/cache"
+ key: "php-${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.lock') }}"
+ restore-keys: "php-${{ matrix.php-version }}-composer-"
+ - name: "Install dependencies with composer in root directory"
+ run: "composer install --no-interaction"
+ - name: "Run tests with phpunit/phpunit in root directory"
+ run: "vendor/bin/phpunit"
- name: "Dump autoloader with composer in root directory"
run: "composer dump-autoload"
-
- name: "Run coding standard checks with squizlabs/php_codesniffer in root directory"
run: "composer cs-check"
-
- name: "Run static code analysis with phpstan/phpstan in root directory"
run: "composer phpstan"
- - name: "Regenerate files"
- run: "./safe.php generate"
+ check_sync:
+ name: "Check Sync"
+ runs-on: "ubuntu-24.04"
+ needs: "fetch_defs"
+ steps:
+ - name: "Checkout"
+ uses: "actions/checkout@v4"
+ - name: "Install PHP with extensions"
+ uses: "shivammathur/setup-php@v2"
+ with:
+ coverage: "pcov"
+ php-version: "8.4"
+ - name: "Fetch cached docs"
+ id: cache-php-doc
+ uses: "actions/cache@v4"
+ with:
+ path: "generator/doc/doc-en"
+ key: php-doc-${{ needs.fetch_defs.outputs.date }}
+ - name: "Cache dependencies installed with composer"
+ uses: "actions/cache@v4"
+ with:
+ path: "~/.composer/cache"
+ key: "php-${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.lock') }}"
+ restore-keys: "php-${{ matrix.php-version }}-composer-"
+ - name: "Install dependencies with composer in generator/ directory"
+ run: "composer install --no-interaction"
+ working-directory: "generator"
+ - name: "Install dependencies with composer in root directory"
+ run: "composer install --no-interaction"
+ - name: "Regenerate files and check for differences"
+ run: "./safe.php generate && git diff --exit-code"
working-directory: "generator"
- - name: "Check if regenerated files are different"
- run: |
- if output=$(git status --porcelain) && [ -z "$output" ]; then
- # all is good
- echo "Generated files are the same as committed file: OK"
- else
- # Uncommitted changes
- echo "Generated files are different from commited files. Please run './safe.php generate' command and commit the results."
- echo "Detected changes:"
- git status
- git diff
- echo "Generated files are different from commited files. Please run './safe.php generate' command and commit the results."
- exit 1;
- fi
-
- - name: "Archive code coverage results"
- uses: "actions/upload-artifact@v1"
+ rector:
+ name: "Rector Tests"
+ runs-on: "ubuntu-24.04"
+ steps:
+ - name: "Checkout"
+ uses: "actions/checkout@v4"
+ - name: "Install PHP with extensions"
+ uses: "shivammathur/setup-php@v2"
with:
- name: "build"
- path: "generator/build"
+ php-version: "8.4"
+ - name: "Composer install"
+ run: "composer install && composer rector && composer test"
+ working-directory: "generator/tests/rector"
+ - name: "Run rector"
+ run: "composer rector"
+ working-directory: "generator/tests/rector"
+ - name: "Run tests"
+ run: "composer test"
+ working-directory: "generator/tests/rector"
- - uses: codecov/codecov-action@v1 # upload the coverage to codecov
- with:
- fail_ci_if_error: true # optional (default = false)
diff --git a/.github/workflows/rector-continuous-integration.yml b/.github/workflows/rector-continuous-integration.yml
deleted file mode 100644
index 10f5eb98..00000000
--- a/.github/workflows/rector-continuous-integration.yml
+++ /dev/null
@@ -1,44 +0,0 @@
-# https://help.github.com/en/categories/automating-your-workflow-with-github-actions
-
-name: "Rector Continuous Integration"
-
-on:
- - "pull_request"
- - "push"
-
-jobs:
-
- rector-continuous-integration:
- name: "Check if refactoring can be done with rector/rector"
-
- runs-on: "ubuntu-latest"
-
- strategy:
- matrix:
- php-version:
- - "8.0"
-
- dependencies:
- - "highest"
-
- steps:
- - name: "Checkout"
- uses: "actions/checkout@v2"
-
- - name: "Install PHP with extensions"
- uses: "shivammathur/setup-php@v2"
- with:
- php-version: "${{ matrix.php-version }}"
-
- - name: "Composer install"
- run: "composer install && composer rector && composer test"
- working-directory: "generator/tests/rector"
-
- - name: "Run rector"
- run: "composer rector"
- working-directory: "generator/tests/rector"
-
- - name: "Run tests"
- run: "composer test"
- working-directory: "generator/tests/rector"
-
diff --git a/.gitignore b/.gitignore
index 4a7f4685..0598dde9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,5 +4,7 @@
/generator/doc/entities/generated.ent
/composer.lock
vendor/
+/generator/composer.lock
/generator/tests/rector/composer.lock
+/generator/.phpunit.cache/
.phpunit.result.cache
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index ecb2c1b9..9f9cf3e8 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -2,6 +2,19 @@
Safe-PHP code is generated automatically from the PHP doc.
+## Install dependencies
+
+### With a devcontainer
+
+If you use VSCode or similar, opening the project folder should prompt you to
+re-open the folder inside a docker container with all the relevant tools
+pre-installed.
+
+### Manually
+
+- php8.2+ CLI (with dom and curl modules)
+- composer
+
## How to install Safe-PHP development environment
The first step is to download the PHP documentation project locally, using git.
diff --git a/README.md b/README.md
index 4b63d155..59b6de60 100644
--- a/README.md
+++ b/README.md
@@ -1,16 +1,16 @@
-[](https://packagist.org/packages/thecodingmachine/safe)
-[](https://packagist.org/packages/thecodingmachine/safe)
-[](https://packagist.org/packages/thecodingmachine/safe)
-[](https://packagist.org/packages/thecodingmachine/safe)
-[](https://travis-ci.org/thecodingmachine/safe)
-[](https://github.com/thecodingmachine/safe/actions)
-[](https://codecov.io/gh/thecodingmachine/safe)
+[](https://packagist.org/packages/shish/safe)
+[](https://packagist.org/packages/shish/safe)
+[](https://packagist.org/packages/shish/safe)
+[](https://github.com/shish/safe/actions)
-Safe PHP
-========
+
+Safe PHP8
+=========
A set of core PHP functions rewritten to throw exceptions instead of returning `false` when an error is encountered.
+Forked from `thecodingmachine/safe` who did an amazing job of solving the problem for php7, and then disappeared.
+
## The problem
Most PHP core functions were written before exception handling was added to the language. Therefore, most PHP functions
@@ -43,7 +43,7 @@ Obviously, while this snippet is correct, it is less easy to read.
## The solution
-Enter *thecodingmachine/safe* aka Safe-PHP.
+Enter *shish/safe* aka Safe-PHP.
Safe-PHP redeclares all core PHP functions. The new PHP functions act exactly as the old ones, except they
throw exceptions properly when an error is encountered. The "safe" functions have the same name as the core PHP
@@ -66,7 +66,7 @@ In addition, Safe also provide 2 'Safe' classes: `Safe\DateTime` and `Safe\DateT
> Yeah... but I must explicitly think about importing the "safe" variant of the function, for each and every file of my application.
> I'm sure I will forget some "use function" statements!
-Fear not! thecodingmachine/safe comes with a PHPStan rule.
+Fear not! shish/safe comes with a PHPStan rule.
Never heard of [PHPStan](https://github.com/phpstan/phpstan) before?
Check it out, it's an amazing code analyzer for PHP.
@@ -79,27 +79,27 @@ The code below will trigger this warning:
$content = file_get_contents('foobar.json');
```
-> Function file_get_contents is unsafe to use. It can return FALSE instead of throwing an exception. Please add 'use function Safe\\file_get_contents;' at the beginning of the file to use the variant provided by the 'thecodingmachine/safe' library.
+> Function file_get_contents is unsafe to use. It can return FALSE instead of throwing an exception. Please add 'use function Safe\\file_get_contents;' at the beginning of the file to use the variant provided by the 'shish/safe' library.
## Installation
Use composer to install Safe-PHP:
```bash
-$ composer require thecodingmachine/safe
+$ composer require shish/safe
```
*Highly recommended*: install PHPStan and PHPStan extension:
```bash
-$ composer require --dev thecodingmachine/phpstan-safe-rule
+$ composer require --dev shish/phpstan-safe-rule
```
Now, edit your `phpstan.neon` file and add these rules:
```yml
includes:
- - vendor/thecodingmachine/phpstan-safe-rule/phpstan-safe-rule.neon
+ - vendor/shish/phpstan-safe-rule/phpstan-safe-rule.neon
```
## Automated refactoring
@@ -121,7 +121,7 @@ to install `rector/rector`.
Run
```bash
-vendor/bin/rector process src/ --config vendor/thecodingmachine/safe/rector-migrate.php
+vendor/bin/rector process src/ --config vendor/shish/safe/rector-migrate.php
```
to run `rector/rector`.
diff --git a/composer.json b/composer.json
index e85a6593..afd53278 100644
--- a/composer.json
+++ b/composer.json
@@ -1,6 +1,6 @@
{
- "name": "thecodingmachine/safe",
- "description": "PHP core functions that throw exceptions instead of returning FALSE on error",
+ "name": "shish/safe",
+ "description": "PHP core functions that throw exceptions instead of returning FALSE on error (a less-abandoned fork of thecodingmachine/safe)",
"license": "MIT",
"autoload": {
"classmap": [
@@ -43,7 +43,6 @@
"generated/ftp.php",
"generated/funchand.php",
"generated/gettext.php",
- "generated/gmp.php",
"generated/gnupg.php",
"generated/hash.php",
"generated/ibase.php",
@@ -73,6 +72,7 @@
"generated/ps.php",
"generated/pspell.php",
"generated/readline.php",
+ "generated/rnp.php",
"generated/rpminfo.php",
"generated/rrd.php",
"generated/sem.php",
@@ -102,22 +102,20 @@
]
},
"require": {
- "php": "^8.0"
+ "php": ">= 8.2"
},
"require-dev": {
- "phpstan/phpstan": "^1.5",
+ "phpstan/phpstan": "^1",
"thecodingmachine/phpstan-strict-rules": "^1.0",
- "squizlabs/php_codesniffer": "^3.2",
- "phpunit/phpunit": "^9.5"
+ "squizlabs/php_codesniffer": "^3",
+ "phpunit/phpunit": "^10.0 || ^11.0"
},
"scripts": {
- "phpstan": "phpstan analyse lib -c phpstan.neon --level=max --no-progress -vvv",
+ "phpstan": "phpstan analyse",
"cs-fix": "phpcbf",
"cs-check": "phpcs"
},
- "extra": {
- "branch-alias": {
- "dev-master": "2.2.x-dev"
- }
+ "replace": {
+ "thecodingmachine/safe": "2.5.0"
}
}
\ No newline at end of file
diff --git a/deprecated/datetime.php b/deprecated/datetime.php
index 012b0f7c..f511a3a7 100644
--- a/deprecated/datetime.php
+++ b/deprecated/datetime.php
@@ -21,7 +21,7 @@
* @deprecated The Safe version of this function is no longer needed in PHP 8.0+
*
*/
-function gmdate(string $format, int $timestamp = null): string
+function gmdate(string $format, ?int $timestamp = null): string
{
error_clear_last();
if ($timestamp !== null) {
@@ -75,7 +75,7 @@ function gmdate(string $format, int $timestamp = null): string
* @deprecated The Safe version of this function is no longer needed in PHP 8.0+
*
*/
-function mktime(int $hour, int $minute = null, int $second = null, int $month = null, int $day = null, int $year = null): int
+function mktime(int $hour, ?int $minute = null, ?int $second = null, ?int $month = null, ?int $day = null, ?int $year = null): int
{
error_clear_last();
if ($year !== null) {
diff --git a/deprecated/mssql.php b/deprecated/mssql.php
index 234ef56b..aa44ad0d 100644
--- a/deprecated/mssql.php
+++ b/deprecated/mssql.php
@@ -97,7 +97,7 @@ function mssql_close($link_identifier = null): void
* @throws MssqlException
*
*/
-function mssql_connect(string $servername = null, string $username = null, string $password = null, bool $new_link = false)
+function mssql_connect(?string $servername = null, ?string $username = null, ?string $password = null, bool $new_link = false)
{
error_clear_last();
if ($new_link !== false) {
@@ -330,7 +330,7 @@ function mssql_init(string $sp_name, $link_identifier = null)
* @throws MssqlException
*
*/
-function mssql_pconnect(string $servername = null, string $username = null, string $password = null, bool $new_link = false)
+function mssql_pconnect(?string $servername = null, ?string $username = null, ?string $password = null, bool $new_link = false)
{
error_clear_last();
if ($new_link !== false) {
diff --git a/deprecated/password.php b/deprecated/password.php
index 87d85a7b..10f8b2f2 100644
--- a/deprecated/password.php
+++ b/deprecated/password.php
@@ -112,7 +112,7 @@
* @deprecated The Safe version of this function is no longer needed in PHP 8.0+
*
*/
-function password_hash(string $password, $algo, array $options = null): string
+function password_hash(string $password, $algo, ?array $options = null): string
{
error_clear_last();
if ($options !== null) {
diff --git a/deprecated/strings.php b/deprecated/strings.php
index de0c2e60..9e273237 100644
--- a/deprecated/strings.php
+++ b/deprecated/strings.php
@@ -361,7 +361,7 @@ function sprintf(string $format, ...$params): string
* @deprecated The Safe version of this function is no longer needed in PHP 8.0+
*
*/
-function substr(string $string, int $start, int $length = null): string
+function substr(string $string, int $start, ?int $length = null): string
{
error_clear_last();
if ($length !== null) {
diff --git a/generated/Exceptions/ApacheException.php b/generated/Exceptions/ApacheException.php
index ab2149df..fd1c5819 100644
--- a/generated/Exceptions/ApacheException.php
+++ b/generated/Exceptions/ApacheException.php
@@ -1,4 +1,5 @@
*
*
- * So, $out[0] contains array of strings that matched full pattern,
- * and $out[1] contains array of strings enclosed by tags.
+ * So, $out[0] contains an array of strings that matched the full pattern,
+ * and $out[1] contains an array of strings enclosed by tags.
*
*
*
@@ -209,15 +209,15 @@ function preg_grep(string $pattern, array $array, int $flags = 0): array
* ]]>
*
*
- * So, $out[0] contains array of strings that matched full pattern,
- * and $out[1] contains array of strings enclosed by tags.
+ * So, $out[0] contains an array of strings that matched the full pattern,
+ * and $out[1] contains an array of strings enclosed by tags.
*
*
*
* The above example will output:
*
- * So, $out[0] contains array of strings that matched full pattern,
- * and $out[1] contains array of strings enclosed by tags.
+ * So, $out[0] contains an array of strings that matched the full pattern,
+ * and $out[1] contains an array of strings enclosed by tags.
*
* If the pattern contains named subpatterns, $matches
* additionally contains entries for keys with the subpattern name.
@@ -339,15 +339,15 @@ function preg_grep(string $pattern, array $array, int $flags = 0): array
* ]]>
*
*
- * So, $out[0] contains array of strings that matched full pattern,
- * and $out[1] contains array of strings enclosed by tags.
+ * So, $out[0] contains an array of strings that matched the full pattern,
+ * and $out[1] contains an array of strings enclosed by tags.
*
*
*
* The above example will output:
*
- * So, $out[0] contains array of strings that matched full pattern,
- * and $out[1] contains array of strings enclosed by tags.
+ * So, $out[0] contains an array of strings that matched the full pattern,
+ * and $out[1] contains an array of strings enclosed by tags.
*
* If the pattern contains named subpatterns, $matches
* additionally contains entries for keys with the subpattern name.
diff --git a/generated/pgsql.php b/generated/pgsql.php
index 9968a5ae..346519fb 100644
--- a/generated/pgsql.php
+++ b/generated/pgsql.php
@@ -150,7 +150,7 @@ function pg_convert($connection, string $table_name, array $values, int $flags =
* @throws PgsqlException
*
*/
-function pg_copy_from($connection, string $table_name, array $rows, string $separator = "\t", string $null_as = "\\\\N"): void
+function pg_copy_from($connection, string $table_name, array $rows, string $separator = "\t", string $null_as = "\\N"): void
{
error_clear_last();
$safeResult = \pg_copy_from($connection, $table_name, $rows, $separator, $null_as);
@@ -175,7 +175,7 @@ function pg_copy_from($connection, string $table_name, array $rows, string $sepa
* @throws PgsqlException
*
*/
-function pg_copy_to($connection, string $table_name, string $separator = "\t", string $null_as = "\\\\N"): array
+function pg_copy_to($connection, string $table_name, string $separator = "\t", string $null_as = "\\N"): array
{
error_clear_last();
$safeResult = \pg_copy_to($connection, $table_name, $separator, $null_as);
@@ -297,7 +297,7 @@ function pg_end_copy($connection = null): void
* @throws PgsqlException
*
*/
-function pg_execute($connection = null, string $stmtname = null, array $params = null)
+function pg_execute($connection = null, ?string $stmtname = null, ?array $params = null)
{
error_clear_last();
if ($params !== null) {
@@ -542,7 +542,7 @@ function pg_lo_close($lob): void
* @throws PgsqlException
*
*/
-function pg_lo_export($connection = null, int $oid = null, string $pathname = null): void
+function pg_lo_export($connection = null, ?int $oid = null, ?string $pathname = null): void
{
error_clear_last();
if ($pathname !== null) {
@@ -584,7 +584,7 @@ function pg_lo_export($connection = null, int $oid = null, string $pathname = nu
* @throws PgsqlException
*
*/
-function pg_lo_import($connection = null, string $pathname = null, $object_id = null): int
+function pg_lo_import($connection = null, ?string $pathname = null, $object_id = null): int
{
error_clear_last();
if ($object_id !== null) {
@@ -748,7 +748,7 @@ function pg_lo_unlink($connection, int $oid): void
* @throws PgsqlException
*
*/
-function pg_lo_write($lob, string $data, int $length = null): int
+function pg_lo_write($lob, string $data, ?int $length = null): int
{
error_clear_last();
if ($length !== null) {
@@ -824,7 +824,7 @@ function pg_meta_data($connection, string $table_name, bool $extended = false):
* @throws PgsqlException
*
*/
-function pg_parameter_status($connection = null, string $param_name = null): string
+function pg_parameter_status($connection = null, ?string $param_name = null): string
{
error_clear_last();
if ($param_name !== null) {
@@ -935,13 +935,14 @@ function pg_ping($connection = null): void
* create an unnamed statement, in which case any pre-existing unnamed
* statement is automatically replaced; otherwise it is an error if the
* statement name is already defined in the current session. If any parameters
- * are used, they are referred to in the query as $1, $2, etc.
+ * are used, they are referred to in the query as $1,
+ * $2, etc.
*
* Prepared statements for use with pg_prepare can also be created by
- * executing SQL PREPARE statements. (But pg_prepare is more flexible since it
- * does not require parameter types to be pre-specified.) Also, although there
- * is no PHP function for deleting a prepared statement, the SQL DEALLOCATE
- * statement can be used for that purpose.
+ * executing SQL PREPARE statements. (But pg_prepare is
+ * more flexible since it does not require parameter types to be pre-specified.) Also,
+ * although there is no PHP function for deleting a prepared statement, the
+ * SQL DEALLOCATE statement can be used for that purpose.
*
* @param resource $connection An PgSql\Connection instance.
* When connection is unspecified, the default connection is used.
@@ -951,14 +952,14 @@ function pg_ping($connection = null): void
* @param string $stmtname The name to give the prepared statement. Must be unique per-connection. If
* "" is specified, then an unnamed statement is created, overwriting any
* previously defined unnamed statement.
- * @param string $query The parameterized SQL statement. Must contain only a single statement.
- * (multiple statements separated by semi-colons are not allowed.) If any parameters
+ * @param string $query The parameterized SQL statement. Must contain only a single statement
+ * (multiple statements separated by semi-colons are not allowed). If any parameters
* are used, they are referred to as $1, $2, etc.
* @return resource An PgSql\Result instance on success.
* @throws PgsqlException
*
*/
-function pg_prepare($connection = null, string $stmtname = null, string $query = null)
+function pg_prepare($connection = null, ?string $stmtname = null, ?string $query = null)
{
error_clear_last();
if ($query !== null) {
@@ -1000,7 +1001,7 @@ function pg_prepare($connection = null, string $stmtname = null, string $query =
* @throws PgsqlException
*
*/
-function pg_put_line($connection = null, string $data = null): void
+function pg_put_line($connection = null, ?string $data = null): void
{
error_clear_last();
if ($data !== null) {
@@ -1067,7 +1068,7 @@ function pg_put_line($connection = null, string $data = null): void
* @throws PgsqlException
*
*/
-function pg_query_params($connection = null, string $query = null, array $params = null)
+function pg_query_params($connection = null, ?string $query = null, ?array $params = null)
{
error_clear_last();
if ($params !== null) {
@@ -1126,7 +1127,7 @@ function pg_query_params($connection = null, string $query = null, array $params
* @throws PgsqlException
*
*/
-function pg_query($connection = null, string $query = null)
+function pg_query($connection = null, ?string $query = null)
{
error_clear_last();
if ($query !== null) {
@@ -1211,10 +1212,16 @@ function pg_result_seek($result, int $row): void
* array containing all records and fields that match the condition
* specified by conditions.
*
- * If flags is specified,
+ * If flags is set,
* pg_convert is applied to
* conditions with the specified flags.
*
+ * If mode is set,
+ * the return value will be in the form of an array
+ * with PGSQL_NUM, an associative array
+ * with PGSQL_ASSOC (default) or both
+ * with PGSQL_BOTH.
+ *
* By default pg_select passes raw values. Values
* must be escaped or PGSQL_DML_ESCAPE option must be
* specified. PGSQL_DML_ESCAPE quotes and escapes
@@ -1235,9 +1242,15 @@ function pg_result_seek($result, int $row): void
* PGSQL_DML_EXEC,
* PGSQL_DML_ASYNC or
* PGSQL_DML_STRING combined. If PGSQL_DML_STRING is part of the
- * flags then query string is returned. When PGSQL_DML_NO_CONV
+ * flags then the query string is returned. When PGSQL_DML_NO_CONV
* or PGSQL_DML_ESCAPE is set, it does not call pg_convert internally.
- * @param int $mode
+ * @param int $mode Any number of PGSQL_ASSOC,
+ * PGSQL_NUM or
+ * PGSQL_BOTH
+ * If PGSQL_ASSOC is set the return value will be an associative array,
+ * with PGSQL_NUM the return value will be an array, and
+ * with PGSQL_BOTH the return value will be both an associative and
+ * numerically indexed array.
* @return mixed Returns string if PGSQL_DML_STRING is passed
* via flags, otherwise it returns an array on success.
* @throws PgsqlException
@@ -1254,6 +1267,24 @@ function pg_select($connection, string $table_name, array $conditions, int $flag
}
+/**
+ *
+ *
+ * @param \PgSql\Connection $connection An PgSql\Connection instance.
+ * @param int $size
+ * @throws PgsqlException
+ *
+ */
+function pg_set_chunked_rows_size(\PgSql\Connection $connection, int $size): void
+{
+ error_clear_last();
+ $safeResult = \pg_set_chunked_rows_size($connection, $size);
+ if ($safeResult === false) {
+ throw PgsqlException::createFromPhpError();
+ }
+}
+
+
/**
* pg_socket returns a read only resource
* corresponding to the socket underlying the given PostgreSQL connection.
@@ -1295,13 +1326,18 @@ function pg_socket($connection)
* The default connection is the last connection made by pg_connect
* or pg_pconnect.
* As of PHP 8.1.0, using the default connection is deprecated.
+ * @param int $trace_mode An optional trace mode with the following constants
+ * PGSQL_TRACE_SUPPRESS_TIMESTAMPS and
+ * PGSQL_TRACE_REGRESS_MODE
* @throws PgsqlException
*
*/
-function pg_trace(string $filename, string $mode = "w", $connection = null): void
+function pg_trace(string $filename, string $mode = "w", $connection = null, int $trace_mode = 0): void
{
error_clear_last();
- if ($connection !== null) {
+ if ($trace_mode !== 0) {
+ $safeResult = \pg_trace($filename, $mode, $connection, $trace_mode);
+ } elseif ($connection !== null) {
$safeResult = \pg_trace($filename, $mode, $connection);
} else {
$safeResult = \pg_trace($filename, $mode);
diff --git a/generated/posix.php b/generated/posix.php
index ea50d848..f4522629 100644
--- a/generated/posix.php
+++ b/generated/posix.php
@@ -30,11 +30,37 @@ function posix_access(string $filename, int $flags = 0): void
}
+/**
+ * posix_eaccess checks the effective user's permission of a file
+ *
+ * @param string $filename The name of a file to be tested.
+ * @param int $flags A mask consisting of one or more of POSIX_F_OK,
+ * POSIX_R_OK, POSIX_W_OK and
+ * POSIX_X_OK.
+ *
+ * POSIX_R_OK, POSIX_W_OK and
+ * POSIX_X_OK request checking whether the file
+ * exists and has read, write and execute permissions, respectively.
+ * POSIX_F_OK just requests checking for the
+ * existence of the file.
+ * @throws PosixException
+ *
+ */
+function posix_eaccess(string $filename, int $flags = 0): void
+{
+ error_clear_last();
+ $safeResult = \posix_eaccess($filename, $flags);
+ if ($safeResult === false) {
+ throw PosixException::createFromPhpError();
+ }
+}
+
+
/**
* Gets information about a group provided its id.
*
* @param int $group_id The group id.
- * @return array The array elements returned are:
+ * @return array{name: string, passwd: string, gid: int, members: array} The array elements returned are:
*
* The group information array
*
@@ -98,7 +124,7 @@ function posix_getgrgid(int $group_id): array
* Gets information about a group provided its name.
*
* @param string $name The name of the group
- * @return array Returns an array on success.
+ * @return array{name: string, passwd: string, gid: int, members: array} Returns an array on success.
* The array elements returned are:
*
* The group information array
@@ -200,7 +226,7 @@ function posix_getlogin(): string
* referenced by the given user ID.
*
* @param int $user_id The user identifier.
- * @return array Returns an associative array with the following elements:
+ * @return array{name: string, passwd: string, uid: int, gid: int, gecos: string, dir: string, shell: string} Returns an associative array with the following elements:
*
* The user information array
*
@@ -298,6 +324,8 @@ function posix_getpwuid(int $user_id): array
* An unprivileged process may only set its soft limit to a value
* from 0 to the hard limit, and irreversibly lower its hard limit.
*
+ * @param $resource If NULL all resource limits will be fetched.
+ * Otherwise, the only limits of the resource type provided will be returned.
* @return array Returns an associative array of elements for each
* limit that is defined. Each limit has a soft and a hard limit.
*
@@ -386,10 +414,14 @@ function posix_getpwuid(int $user_id): array
* @throws PosixException
*
*/
-function posix_getrlimit(): array
+function posix_getrlimit($resource = null): array
{
error_clear_last();
- $safeResult = \posix_getrlimit();
+ if ($resource !== null) {
+ $safeResult = \posix_getrlimit($resource);
+ } else {
+ $safeResult = \posix_getrlimit();
+ }
if ($safeResult === false) {
throw PosixException::createFromPhpError();
}
diff --git a/generated/ps.php b/generated/ps.php
index 6ead054b..1eaa9774 100644
--- a/generated/ps.php
+++ b/generated/ps.php
@@ -778,7 +778,7 @@ function ps_fill($psdoc): void
* @throws PsException
*
*/
-function ps_get_parameter($psdoc, string $name, float $modifier = null): string
+function ps_get_parameter($psdoc, string $name, ?float $modifier = null): string
{
error_clear_last();
if ($modifier !== null) {
@@ -925,7 +925,7 @@ function ps_new()
* @throws PsException
*
*/
-function ps_open_file($psdoc, string $filename = null): void
+function ps_open_file($psdoc, ?string $filename = null): void
{
error_clear_last();
if ($filename !== null) {
diff --git a/generated/pspell.php b/generated/pspell.php
index 7ef3d259..24864bdc 100644
--- a/generated/pspell.php
+++ b/generated/pspell.php
@@ -57,50 +57,6 @@ function pspell_clear_session(int $dictionary): void
}
-/**
- * Create a config used to open a dictionary.
- *
- * pspell_config_create has a very similar syntax to
- * pspell_new. In fact, using
- * pspell_config_create immediately followed by
- * pspell_new_config will produce the exact same result.
- * However, after creating a new config, you can also use
- * pspell_config_* functions before calling
- * pspell_new_config to take advantage of some
- * advanced functionality.
- *
- * For more information and examples, check out inline manual pspell
- * website:http://aspell.net/.
- *
- * @param string $language The language parameter is the language code which consists of the
- * two letter ISO 639 language code and an optional two letter ISO
- * 3166 country code after a dash or underscore.
- * @param string $spelling The spelling parameter is the requested spelling for languages
- * with more than one spelling such as English. Known values are
- * 'american', 'british', and 'canadian'.
- * @param string $jargon The jargon parameter contains extra information to distinguish
- * two different words lists that have the same language and
- * spelling parameters.
- * @param string $encoding The encoding parameter is the encoding that words are expected to
- * be in. Valid values are 'utf-8', 'iso8859-*', 'koi8-r',
- * 'viscii', 'cp1252', 'machine unsigned 16', 'machine unsigned
- * 32'. This parameter is largely untested, so be careful when
- * using.
- * @return int Returns an PSpell\Config instance on success.
- * @throws PspellException
- *
- */
-function pspell_config_create(string $language, string $spelling = "", string $jargon = "", string $encoding = ""): int
-{
- error_clear_last();
- $safeResult = \pspell_config_create($language, $spelling, $jargon, $encoding);
- if ($safeResult === false) {
- throw PspellException::createFromPhpError();
- }
- return $safeResult;
-}
-
-
/**
* This function is
* currently not documented; only its argument list is available.
diff --git a/generated/readline.php b/generated/readline.php
index d8b82181..6e202f50 100644
--- a/generated/readline.php
+++ b/generated/readline.php
@@ -90,7 +90,7 @@ function readline_completion_function(callable $callback): void
* @throws ReadlineException
*
*/
-function readline_read_history(string $filename = null): void
+function readline_read_history(?string $filename = null): void
{
error_clear_last();
if ($filename !== null) {
@@ -111,7 +111,7 @@ function readline_read_history(string $filename = null): void
* @throws ReadlineException
*
*/
-function readline_write_history(string $filename = null): void
+function readline_write_history(?string $filename = null): void
{
error_clear_last();
if ($filename !== null) {
diff --git a/generated/rnp.php b/generated/rnp.php
new file mode 100644
index 00000000..9b5587b6
--- /dev/null
+++ b/generated/rnp.php
@@ -0,0 +1,609 @@
+
- * ]]>
- *
- * See section 4.7 of the XML 1.0
- * spec for the definition of notation declarations.
- *
- * @param resource $parser A reference to the XML parser to set up notation declaration handler function.
- * @param callable $handler handler is a string containing the name of a
- * function that must exist when xml_parse is called
- * for parser.
- *
- * The function named by handler must accept
- * five parameters:
- *
- * handler
- * XMLParserparser
- * stringnotation_name
- * stringbase
- * stringsystem_id
- * stringpublic_id
- *
- *
- *
- *
- * parser
- *
- *
- *
- * The first parameter, parser, is a
- * reference to the XML parser calling the handler.
- *
- *
- *
- *
- * notation_name
- *
- *
- * This is the notation's name, as per
- * the notation format described above.
- *
- *
- *
- *
- *
- * base
- *
- *
- *
- * This is the base for resolving the system identifier
- * (system_id) of the notation declaration.
- * Currently this parameter will always be set to an empty string.
- *
- *
- *
- *
- * system_id
- *
- *
- * System identifier of the external notation declaration.
- *
- *
- *
- *
- *
- * public_id
- *
- *
- *
- * Public identifier of the external notation declaration.
- *
- *
- *
- *
- *
- * If a handler function is set to an empty string, or FALSE, the handler
- * in question is disabled.
- * @throws XmlException
- *
- */
-function xml_set_notation_decl_handler($parser, callable $handler): void
-{
- error_clear_last();
- $safeResult = \xml_set_notation_decl_handler($parser, $handler);
- if ($safeResult === false) {
- throw XmlException::createFromPhpError();
- }
-}
-
-
-/**
- * This function allows to use parser inside
- * object. All callback functions could be set with
- * xml_set_element_handler etc and assumed to be
- * methods of object.
- *
- * @param resource $parser A reference to the XML parser to use inside the object.
- * @param object $object The object where to use the XML parser.
- * @throws XmlException
- *
- */
-function xml_set_object($parser, object $object): void
-{
- error_clear_last();
- $safeResult = \xml_set_object($parser, $object);
- if ($safeResult === false) {
- throw XmlException::createFromPhpError();
- }
-}
-
-
-/**
- * Sets the processing instruction (PI) handler function for the XML parser
- * parser.
- *
- * A processing instruction has the following format:
- *
- * <?target
- * data?>
- *
- *
- * You can put PHP code into such a tag, but be aware of one limitation: in
- * an XML PI, the PI end tag (?>) can not be quoted,
- * so this character sequence should not appear in the PHP code you embed
- * with PIs in XML documents.If it does, the rest of the PHP code, as well
- * as the "real" PI end tag, will be treated as character data.
- *
- * @param resource $parser A reference to the XML parser to set up processing instruction (PI) handler function.
- * @param callable $handler handler is a string containing the name of a
- * function that must exist when xml_parse is called
- * for parser.
- *
- * The function named by handler must accept
- * three parameters:
- *
- * handler
- * XMLParserparser
- * stringtarget
- * stringdata
- *
- *
- *
- * parser
- *
- *
- * The first parameter, parser, is a
- * reference to the XML parser calling the handler.
- *
- *
- *
- *
- * target
- *
- *
- * The second parameter, target, contains the PI
- * target.
- *
- *
- *
- *
- * data
- *
- *
- * The third parameter, data, contains the PI
- * data.
- *
- *
- *
- *
- *
- * If a handler function is set to an empty string, or FALSE, the handler
- * in question is disabled.
- * @throws XmlException
- *
- */
-function xml_set_processing_instruction_handler($parser, callable $handler): void
-{
- error_clear_last();
- $safeResult = \xml_set_processing_instruction_handler($parser, $handler);
- if ($safeResult === false) {
- throw XmlException::createFromPhpError();
- }
-}
-
-
-/**
- * Set a handler to be called when a namespace is declared. Namespace
- * declarations occur inside start tags. But the namespace declaration start
- * handler is called before the start tag handler for each namespace declared
- * in that start tag.
- *
- * @param resource $parser A reference to the XML parser.
- * @param callable $handler handler is a string containing the name of a
- * function that must exist when xml_parse is called
- * for parser.
- *
- * The function named by handler must accept
- * three parameters, and should return an integer value. If the
- * value returned from the handler is FALSE (which it will be if no
- * value is returned), the XML parser will stop parsing and
- * xml_get_error_code will return
- * XML_ERROR_EXTERNAL_ENTITY_HANDLING.
- *
- * handler
- * XMLParserparser
- * stringprefix
- * stringuri
- *
- *
- *
- * parser
- *
- *
- * The first parameter, parser, is a
- * reference to the XML parser calling the handler.
- *
- *
- *
- *
- * prefix
- *
- *
- * The prefix is a string used to reference the namespace within an XML object.
- *
- *
- *
- *
- * uri
- *
- *
- * Uniform Resource Identifier (URI) of namespace.
- *
- *
- *
- *
- *
- * If a handler function is set to an empty string, or FALSE, the handler
- * in question is disabled.
- * @throws XmlException
- *
- */
-function xml_set_start_namespace_decl_handler($parser, callable $handler): void
-{
- error_clear_last();
- $safeResult = \xml_set_start_namespace_decl_handler($parser, $handler);
- if ($safeResult === false) {
- throw XmlException::createFromPhpError();
- }
-}
-
-
-/**
- * Sets the unparsed entity declaration handler function for the XML parser
- * parser.
- *
- * The handler will be called if the XML parser
- * encounters an external entity declaration with an NDATA declaration, like
- * the following:
- *
- * name {publicId | systemId}
- * NDATA notationName
- * ]]>
- *
- *
- * See section 4.2.2 of
- * the XML 1.0 spec for the definition of notation declared
- * external entities.
- *
- * @param resource $parser A reference to the XML parser to set up unparsed entity declaration handler function.
- * @param callable $handler handler is a string containing the name of a
- * function that must exist when xml_parse is called
- * for parser.
- *
- * The function named by handler must accept six
- * parameters:
- *
- * handler
- * XMLParserparser
- * stringentity_name
- * stringbase
- * stringsystem_id
- * stringpublic_id
- * stringnotation_name
- *
- *
- *
- * parser
- *
- *
- * The first parameter, parser, is a
- * reference to the XML parser calling the
- * handler.
- *
- *
- *
- *
- * entity_name
- *
- *
- * The name of the entity that is about to be defined.
- *
- *
- *
- *
- * base
- *
- *
- * This is the base for resolving the system identifier
- * (systemId) of the external entity.Currently
- * this parameter will always be set to an empty string.
- *
- *
- *
- *
- * system_id
- *
- *
- * System identifier for the external entity.
- *
- *
- *
- *
- * public_id
+ * Specify how many characters should be skipped in the beginning of a
+ * tag name.
*
*
- * Public identifier for the external entity.
*
+ * XML_OPTION_SKIP_WHITE
+ * bool
*
+ * Whether to skip values consisting of whitespace characters.
*
*
- * notation_name
*
+ * XML_OPTION_TARGET_ENCODING
+ * string
*
- * Name of the notation of this entity (see
- * xml_set_notation_decl_handler).
+ * Sets which target encoding to
+ * use in this XML parser.By default, it is set to the same as the
+ * source encoding used by xml_parser_create.
+ * Supported target encodings are ISO-8859-1,
+ * US-ASCII and UTF-8.
*
*
*
*
*
- * If a handler function is set to an empty string, or FALSE, the handler
- * in question is disabled.
+ * @param mixed $value The option's new value.
* @throws XmlException
*
*/
-function xml_set_unparsed_entity_decl_handler($parser, callable $handler): void
+function xml_parser_set_option($parser, int $option, $value): void
{
error_clear_last();
- $safeResult = \xml_set_unparsed_entity_decl_handler($parser, $handler);
+ $safeResult = \xml_parser_set_option($parser, $option, $value);
if ($safeResult === false) {
throw XmlException::createFromPhpError();
}
diff --git a/generated/yaml.php b/generated/yaml.php
index ba518e9e..8018e638 100644
--- a/generated/yaml.php
+++ b/generated/yaml.php
@@ -16,14 +16,14 @@
* tag => callable mappings. See
* parse callbacks for more
* details.
- * @return mixed Returns the value encoded in input in appropriate
+ * @return mixed Returns the value encoded in filename in appropriate
* PHP type. If pos is -1 an
* array will be returned with one entry for each document found
* in the stream.
* @throws YamlException
*
*/
-function yaml_parse_file(string $filename, int $pos = 0, ?int &$ndocs = null, array $callbacks = null)
+function yaml_parse_file(string $filename, int $pos = 0, ?int &$ndocs = null, ?array $callbacks = null)
{
error_clear_last();
if ($callbacks !== null) {
@@ -52,15 +52,15 @@ function yaml_parse_file(string $filename, int $pos = 0, ?int &$ndocs = null, ar
* number of documents found in stream.
* @param array $callbacks Content handlers for YAML nodes. Associative array of YAML
* tag => callable mappings. See
- * parse callbacks for more
- * @return mixed Returns the value encoded in input in appropriate
+ * parse callbacks for more details.
+ * @return mixed Returns the value encoded in url in appropriate
* PHP type. If pos is
* -1 an array will be returned with one entry
* for each document found in the stream.
* @throws YamlException
*
*/
-function yaml_parse_url(string $url, int $pos = 0, ?int &$ndocs = null, array $callbacks = null)
+function yaml_parse_url(string $url, int $pos = 0, ?int &$ndocs = null, ?array $callbacks = null)
{
error_clear_last();
if ($callbacks !== null) {
@@ -94,7 +94,7 @@ function yaml_parse_url(string $url, int $pos = 0, ?int &$ndocs = null, array $c
* @throws YamlException
*
*/
-function yaml_parse(string $input, int $pos = 0, ?int &$ndocs = null, array $callbacks = null)
+function yaml_parse(string $input, int $pos = 0, ?int &$ndocs = null, ?array $callbacks = null)
{
error_clear_last();
if ($callbacks !== null) {
diff --git a/generated/yaz.php b/generated/yaz.php
index 4730dd0b..ce5dd4d0 100644
--- a/generated/yaz.php
+++ b/generated/yaz.php
@@ -427,7 +427,7 @@ function yaz_search($id, string $type, string $query): void
* @throws YazException
*
*/
-function yaz_wait(array &$options = null)
+function yaz_wait(?array &$options = null)
{
error_clear_last();
$safeResult = \yaz_wait($options);
diff --git a/generated/zlib.php b/generated/zlib.php
index daa555ab..f5e79df5 100644
--- a/generated/zlib.php
+++ b/generated/zlib.php
@@ -298,7 +298,7 @@ function gzfile(string $filename, int $use_include_path = 0): array
* @throws ZlibException
*
*/
-function gzgets($stream, int $length = null): string
+function gzgets($stream, ?int $length = null): string
{
error_clear_last();
if ($length !== null) {
@@ -313,35 +313,6 @@ function gzgets($stream, int $length = null): string
}
-/**
- * Identical to gzgets, except that
- * gzgetss attempts to strip any HTML and PHP
- * tags from the text it reads.
- *
- * @param resource $zp The gz-file pointer. It must be valid, and must point to a file
- * successfully opened by gzopen.
- * @param int $length The length of data to get.
- * @param string $allowable_tags You can use this optional parameter to specify tags which should not
- * be stripped.
- * @return string The uncompressed and stripped string.
- * @throws ZlibException
- *
- */
-function gzgetss($zp, int $length, string $allowable_tags = null): string
-{
- error_clear_last();
- if ($allowable_tags !== null) {
- $safeResult = \gzgetss($zp, $length, $allowable_tags);
- } else {
- $safeResult = \gzgetss($zp, $length);
- }
- if ($safeResult === false) {
- throw ZlibException::createFromPhpError();
- }
- return $safeResult;
-}
-
-
/**
* This function inflates a deflated string.
*
@@ -403,28 +374,6 @@ function gzopen(string $filename, string $mode, int $use_include_path = 0)
}
-/**
- * Reads to EOF on the given gz-file pointer from the current position and
- * writes the (uncompressed) results to standard output.
- *
- * @param resource $stream The gz-file pointer. It must be valid, and must point to a file
- * successfully opened by gzopen.
- * @return int The number of uncompressed characters read from gz
- * and passed through to the input.
- * @throws ZlibException
- *
- */
-function gzpassthru($stream): int
-{
- error_clear_last();
- $safeResult = \gzpassthru($stream);
- if ($safeResult === false) {
- throw ZlibException::createFromPhpError();
- }
- return $safeResult;
-}
-
-
/**
* gzread reads up to length bytes
* from the given gz-file pointer. Reading stops when
@@ -508,7 +457,7 @@ function gzuncompress(string $data, int $max_length = 0): string
* @throws ZlibException
*
*/
-function gzwrite($stream, string $data, int $length = null): int
+function gzwrite($stream, string $data, ?int $length = null): int
{
error_clear_last();
if ($length !== null) {
@@ -542,25 +491,6 @@ function inflate_get_read_len($context): int
}
-/**
- * Usually returns either ZLIB_OK or ZLIB_STREAM_END.
- *
- * @param resource $context
- * @return int Returns decompression status.
- * @throws ZlibException
- *
- */
-function inflate_get_status($context): int
-{
- error_clear_last();
- $safeResult = \inflate_get_status($context);
- if ($safeResult === false) {
- throw ZlibException::createFromPhpError();
- }
- return $safeResult;
-}
-
-
/**
* Incrementally inflates encoded data in the specified context.
*
diff --git a/generator/composer.json b/generator/composer.json
index cb85fae8..ba5c1a35 100644
--- a/generator/composer.json
+++ b/generator/composer.json
@@ -7,29 +7,26 @@
}
},
"require": {
- "php": "^8.0",
+ "php": "^8.2",
"ext-simplexml": "*",
"ext-json": "*",
- "symfony/console": "^4.1.4",
- "symfony/process": "^4.1",
- "symfony/finder": "^4.1"
+ "symfony/console": "^6 || ^7",
+ "symfony/process": "^6 || ^7",
+ "symfony/finder": "^6 || ^7"
},
"require-dev": {
- "phpunit/phpunit": "^9.5",
+ "phpunit/phpunit": "^10 || ^11",
"thecodingmachine/phpstan-strict-rules": "^1.0",
- "squizlabs/php_codesniffer": "^3.2",
+ "squizlabs/php_codesniffer": "^3",
"php-coveralls/php-coveralls": "^2.1",
- "phpstan/phpstan": "^1.5"
+ "phpstan/phpstan": "^1",
+ "rector/rector": "^1"
},
"scripts": {
"test": "vendor/bin/phpunit",
- "phpstan": "phpstan analyse src -c phpstan.neon --level=max --no-progress -vvv",
+ "rector": "rector",
+ "phpstan": "phpstan",
"cs-fix": "phpcbf",
"cs-check": "phpcs"
- },
- "extra": {
- "branch-alias": {
- "dev-master": "0.1-dev"
- }
}
}
diff --git a/generator/composer.lock b/generator/composer.lock
deleted file mode 100644
index a840c7b1..00000000
--- a/generator/composer.lock
+++ /dev/null
@@ -1,3966 +0,0 @@
-{
- "_readme": [
- "This file locks the dependencies of your project to a known state",
- "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
- "This file is @generated automatically"
- ],
- "content-hash": "d6c94263becd754b8ce74fbcf96c6508",
- "packages": [
- {
- "name": "psr/container",
- "version": "1.1.2",
- "source": {
- "type": "git",
- "url": "https://github.com/php-fig/container.git",
- "reference": "513e0666f7216c7459170d56df27dfcefe1689ea"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/php-fig/container/zipball/513e0666f7216c7459170d56df27dfcefe1689ea",
- "reference": "513e0666f7216c7459170d56df27dfcefe1689ea",
- "shasum": ""
- },
- "require": {
- "php": ">=7.4.0"
- },
- "type": "library",
- "autoload": {
- "psr-4": {
- "Psr\\Container\\": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "PHP-FIG",
- "homepage": "https://www.php-fig.org/"
- }
- ],
- "description": "Common Container Interface (PHP FIG PSR-11)",
- "homepage": "https://github.com/php-fig/container",
- "keywords": [
- "PSR-11",
- "container",
- "container-interface",
- "container-interop",
- "psr"
- ],
- "support": {
- "issues": "https://github.com/php-fig/container/issues",
- "source": "https://github.com/php-fig/container/tree/1.1.2"
- },
- "time": "2021-11-05T16:50:12+00:00"
- },
- {
- "name": "symfony/console",
- "version": "v4.4.38",
- "source": {
- "type": "git",
- "url": "https://github.com/symfony/console.git",
- "reference": "5a50085bf5460f0c0d60a50b58388c1249826b8a"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/symfony/console/zipball/5a50085bf5460f0c0d60a50b58388c1249826b8a",
- "reference": "5a50085bf5460f0c0d60a50b58388c1249826b8a",
- "shasum": ""
- },
- "require": {
- "php": ">=7.1.3",
- "symfony/polyfill-mbstring": "~1.0",
- "symfony/polyfill-php73": "^1.8",
- "symfony/polyfill-php80": "^1.16",
- "symfony/service-contracts": "^1.1|^2"
- },
- "conflict": {
- "psr/log": ">=3",
- "symfony/dependency-injection": "<3.4",
- "symfony/event-dispatcher": "<4.3|>=5",
- "symfony/lock": "<4.4",
- "symfony/process": "<3.3"
- },
- "provide": {
- "psr/log-implementation": "1.0|2.0"
- },
- "require-dev": {
- "psr/log": "^1|^2",
- "symfony/config": "^3.4|^4.0|^5.0",
- "symfony/dependency-injection": "^3.4|^4.0|^5.0",
- "symfony/event-dispatcher": "^4.3",
- "symfony/lock": "^4.4|^5.0",
- "symfony/process": "^3.4|^4.0|^5.0",
- "symfony/var-dumper": "^4.3|^5.0"
- },
- "suggest": {
- "psr/log": "For using the console logger",
- "symfony/event-dispatcher": "",
- "symfony/lock": "",
- "symfony/process": ""
- },
- "type": "library",
- "autoload": {
- "psr-4": {
- "Symfony\\Component\\Console\\": ""
- },
- "exclude-from-classmap": [
- "/Tests/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Fabien Potencier",
- "email": "fabien@symfony.com"
- },
- {
- "name": "Symfony Community",
- "homepage": "https://symfony.com/contributors"
- }
- ],
- "description": "Eases the creation of beautiful and testable command line interfaces",
- "homepage": "https://symfony.com",
- "support": {
- "source": "https://github.com/symfony/console/tree/v4.4.38"
- },
- "funding": [
- {
- "url": "https://symfony.com/sponsor",
- "type": "custom"
- },
- {
- "url": "https://github.com/fabpot",
- "type": "github"
- },
- {
- "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
- "type": "tidelift"
- }
- ],
- "time": "2022-01-30T21:23:57+00:00"
- },
- {
- "name": "symfony/deprecation-contracts",
- "version": "v2.5.1",
- "source": {
- "type": "git",
- "url": "https://github.com/symfony/deprecation-contracts.git",
- "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/e8b495ea28c1d97b5e0c121748d6f9b53d075c66",
- "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66",
- "shasum": ""
- },
- "require": {
- "php": ">=7.1"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-main": "2.5-dev"
- },
- "thanks": {
- "name": "symfony/contracts",
- "url": "https://github.com/symfony/contracts"
- }
- },
- "autoload": {
- "files": [
- "function.php"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Nicolas Grekas",
- "email": "p@tchwork.com"
- },
- {
- "name": "Symfony Community",
- "homepage": "https://symfony.com/contributors"
- }
- ],
- "description": "A generic function and convention to trigger deprecation notices",
- "homepage": "https://symfony.com",
- "support": {
- "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.1"
- },
- "funding": [
- {
- "url": "https://symfony.com/sponsor",
- "type": "custom"
- },
- {
- "url": "https://github.com/fabpot",
- "type": "github"
- },
- {
- "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
- "type": "tidelift"
- }
- ],
- "time": "2022-01-02T09:53:40+00:00"
- },
- {
- "name": "symfony/finder",
- "version": "v4.4.37",
- "source": {
- "type": "git",
- "url": "https://github.com/symfony/finder.git",
- "reference": "b17d76d7ed179f017aad646e858c90a2771af15d"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/symfony/finder/zipball/b17d76d7ed179f017aad646e858c90a2771af15d",
- "reference": "b17d76d7ed179f017aad646e858c90a2771af15d",
- "shasum": ""
- },
- "require": {
- "php": ">=7.1.3",
- "symfony/polyfill-php80": "^1.16"
- },
- "type": "library",
- "autoload": {
- "psr-4": {
- "Symfony\\Component\\Finder\\": ""
- },
- "exclude-from-classmap": [
- "/Tests/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Fabien Potencier",
- "email": "fabien@symfony.com"
- },
- {
- "name": "Symfony Community",
- "homepage": "https://symfony.com/contributors"
- }
- ],
- "description": "Finds files and directories via an intuitive fluent interface",
- "homepage": "https://symfony.com",
- "support": {
- "source": "https://github.com/symfony/finder/tree/v4.4.37"
- },
- "funding": [
- {
- "url": "https://symfony.com/sponsor",
- "type": "custom"
- },
- {
- "url": "https://github.com/fabpot",
- "type": "github"
- },
- {
- "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
- "type": "tidelift"
- }
- ],
- "time": "2022-01-02T09:41:36+00:00"
- },
- {
- "name": "symfony/polyfill-mbstring",
- "version": "v1.26.0",
- "source": {
- "type": "git",
- "url": "https://github.com/symfony/polyfill-mbstring.git",
- "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e",
- "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e",
- "shasum": ""
- },
- "require": {
- "php": ">=7.1"
- },
- "provide": {
- "ext-mbstring": "*"
- },
- "suggest": {
- "ext-mbstring": "For best performance"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-main": "1.26-dev"
- },
- "thanks": {
- "name": "symfony/polyfill",
- "url": "https://github.com/symfony/polyfill"
- }
- },
- "autoload": {
- "files": [
- "bootstrap.php"
- ],
- "psr-4": {
- "Symfony\\Polyfill\\Mbstring\\": ""
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Nicolas Grekas",
- "email": "p@tchwork.com"
- },
- {
- "name": "Symfony Community",
- "homepage": "https://symfony.com/contributors"
- }
- ],
- "description": "Symfony polyfill for the Mbstring extension",
- "homepage": "https://symfony.com",
- "keywords": [
- "compatibility",
- "mbstring",
- "polyfill",
- "portable",
- "shim"
- ],
- "support": {
- "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.26.0"
- },
- "funding": [
- {
- "url": "https://symfony.com/sponsor",
- "type": "custom"
- },
- {
- "url": "https://github.com/fabpot",
- "type": "github"
- },
- {
- "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
- "type": "tidelift"
- }
- ],
- "time": "2022-05-24T11:49:31+00:00"
- },
- {
- "name": "symfony/polyfill-php73",
- "version": "v1.25.0",
- "source": {
- "type": "git",
- "url": "https://github.com/symfony/polyfill-php73.git",
- "reference": "cc5db0e22b3cb4111010e48785a97f670b350ca5"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/cc5db0e22b3cb4111010e48785a97f670b350ca5",
- "reference": "cc5db0e22b3cb4111010e48785a97f670b350ca5",
- "shasum": ""
- },
- "require": {
- "php": ">=7.1"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-main": "1.23-dev"
- },
- "thanks": {
- "name": "symfony/polyfill",
- "url": "https://github.com/symfony/polyfill"
- }
- },
- "autoload": {
- "files": [
- "bootstrap.php"
- ],
- "psr-4": {
- "Symfony\\Polyfill\\Php73\\": ""
- },
- "classmap": [
- "Resources/stubs"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Nicolas Grekas",
- "email": "p@tchwork.com"
- },
- {
- "name": "Symfony Community",
- "homepage": "https://symfony.com/contributors"
- }
- ],
- "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions",
- "homepage": "https://symfony.com",
- "keywords": [
- "compatibility",
- "polyfill",
- "portable",
- "shim"
- ],
- "support": {
- "source": "https://github.com/symfony/polyfill-php73/tree/v1.25.0"
- },
- "funding": [
- {
- "url": "https://symfony.com/sponsor",
- "type": "custom"
- },
- {
- "url": "https://github.com/fabpot",
- "type": "github"
- },
- {
- "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
- "type": "tidelift"
- }
- ],
- "time": "2021-06-05T21:20:04+00:00"
- },
- {
- "name": "symfony/polyfill-php80",
- "version": "v1.25.0",
- "source": {
- "type": "git",
- "url": "https://github.com/symfony/polyfill-php80.git",
- "reference": "4407588e0d3f1f52efb65fbe92babe41f37fe50c"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/4407588e0d3f1f52efb65fbe92babe41f37fe50c",
- "reference": "4407588e0d3f1f52efb65fbe92babe41f37fe50c",
- "shasum": ""
- },
- "require": {
- "php": ">=7.1"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-main": "1.23-dev"
- },
- "thanks": {
- "name": "symfony/polyfill",
- "url": "https://github.com/symfony/polyfill"
- }
- },
- "autoload": {
- "files": [
- "bootstrap.php"
- ],
- "psr-4": {
- "Symfony\\Polyfill\\Php80\\": ""
- },
- "classmap": [
- "Resources/stubs"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Ion Bazan",
- "email": "ion.bazan@gmail.com"
- },
- {
- "name": "Nicolas Grekas",
- "email": "p@tchwork.com"
- },
- {
- "name": "Symfony Community",
- "homepage": "https://symfony.com/contributors"
- }
- ],
- "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions",
- "homepage": "https://symfony.com",
- "keywords": [
- "compatibility",
- "polyfill",
- "portable",
- "shim"
- ],
- "support": {
- "source": "https://github.com/symfony/polyfill-php80/tree/v1.25.0"
- },
- "funding": [
- {
- "url": "https://symfony.com/sponsor",
- "type": "custom"
- },
- {
- "url": "https://github.com/fabpot",
- "type": "github"
- },
- {
- "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
- "type": "tidelift"
- }
- ],
- "time": "2022-03-04T08:16:47+00:00"
- },
- {
- "name": "symfony/process",
- "version": "v4.4.37",
- "source": {
- "type": "git",
- "url": "https://github.com/symfony/process.git",
- "reference": "b2d924e5a4cb284f293d5092b1dbf0d364cb8b67"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/symfony/process/zipball/b2d924e5a4cb284f293d5092b1dbf0d364cb8b67",
- "reference": "b2d924e5a4cb284f293d5092b1dbf0d364cb8b67",
- "shasum": ""
- },
- "require": {
- "php": ">=7.1.3",
- "symfony/polyfill-php80": "^1.16"
- },
- "type": "library",
- "autoload": {
- "psr-4": {
- "Symfony\\Component\\Process\\": ""
- },
- "exclude-from-classmap": [
- "/Tests/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Fabien Potencier",
- "email": "fabien@symfony.com"
- },
- {
- "name": "Symfony Community",
- "homepage": "https://symfony.com/contributors"
- }
- ],
- "description": "Executes commands in sub-processes",
- "homepage": "https://symfony.com",
- "support": {
- "source": "https://github.com/symfony/process/tree/v4.4.37"
- },
- "funding": [
- {
- "url": "https://symfony.com/sponsor",
- "type": "custom"
- },
- {
- "url": "https://github.com/fabpot",
- "type": "github"
- },
- {
- "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
- "type": "tidelift"
- }
- ],
- "time": "2022-01-27T17:14:04+00:00"
- },
- {
- "name": "symfony/service-contracts",
- "version": "v2.5.0",
- "source": {
- "type": "git",
- "url": "https://github.com/symfony/service-contracts.git",
- "reference": "1ab11b933cd6bc5464b08e81e2c5b07dec58b0fc"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/symfony/service-contracts/zipball/1ab11b933cd6bc5464b08e81e2c5b07dec58b0fc",
- "reference": "1ab11b933cd6bc5464b08e81e2c5b07dec58b0fc",
- "shasum": ""
- },
- "require": {
- "php": ">=7.2.5",
- "psr/container": "^1.1",
- "symfony/deprecation-contracts": "^2.1"
- },
- "conflict": {
- "ext-psr": "<1.1|>=2"
- },
- "suggest": {
- "symfony/service-implementation": ""
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-main": "2.5-dev"
- },
- "thanks": {
- "name": "symfony/contracts",
- "url": "https://github.com/symfony/contracts"
- }
- },
- "autoload": {
- "psr-4": {
- "Symfony\\Contracts\\Service\\": ""
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Nicolas Grekas",
- "email": "p@tchwork.com"
- },
- {
- "name": "Symfony Community",
- "homepage": "https://symfony.com/contributors"
- }
- ],
- "description": "Generic abstractions related to writing services",
- "homepage": "https://symfony.com",
- "keywords": [
- "abstractions",
- "contracts",
- "decoupling",
- "interfaces",
- "interoperability",
- "standards"
- ],
- "support": {
- "source": "https://github.com/symfony/service-contracts/tree/v2.5.0"
- },
- "funding": [
- {
- "url": "https://symfony.com/sponsor",
- "type": "custom"
- },
- {
- "url": "https://github.com/fabpot",
- "type": "github"
- },
- {
- "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
- "type": "tidelift"
- }
- ],
- "time": "2021-11-04T16:48:04+00:00"
- }
- ],
- "packages-dev": [
- {
- "name": "doctrine/instantiator",
- "version": "1.4.1",
- "source": {
- "type": "git",
- "url": "https://github.com/doctrine/instantiator.git",
- "reference": "10dcfce151b967d20fde1b34ae6640712c3891bc"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/doctrine/instantiator/zipball/10dcfce151b967d20fde1b34ae6640712c3891bc",
- "reference": "10dcfce151b967d20fde1b34ae6640712c3891bc",
- "shasum": ""
- },
- "require": {
- "php": "^7.1 || ^8.0"
- },
- "require-dev": {
- "doctrine/coding-standard": "^9",
- "ext-pdo": "*",
- "ext-phar": "*",
- "phpbench/phpbench": "^0.16 || ^1",
- "phpstan/phpstan": "^1.4",
- "phpstan/phpstan-phpunit": "^1",
- "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5",
- "vimeo/psalm": "^4.22"
- },
- "type": "library",
- "autoload": {
- "psr-4": {
- "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Marco Pivetta",
- "email": "ocramius@gmail.com",
- "homepage": "https://ocramius.github.io/"
- }
- ],
- "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors",
- "homepage": "https://www.doctrine-project.org/projects/instantiator.html",
- "keywords": [
- "constructor",
- "instantiate"
- ],
- "support": {
- "issues": "https://github.com/doctrine/instantiator/issues",
- "source": "https://github.com/doctrine/instantiator/tree/1.4.1"
- },
- "funding": [
- {
- "url": "https://www.doctrine-project.org/sponsorship.html",
- "type": "custom"
- },
- {
- "url": "https://www.patreon.com/phpdoctrine",
- "type": "patreon"
- },
- {
- "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator",
- "type": "tidelift"
- }
- ],
- "time": "2022-03-03T08:28:38+00:00"
- },
- {
- "name": "guzzlehttp/guzzle",
- "version": "7.4.5",
- "source": {
- "type": "git",
- "url": "https://github.com/guzzle/guzzle.git",
- "reference": "1dd98b0564cb3f6bd16ce683cb755f94c10fbd82"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/guzzle/guzzle/zipball/1dd98b0564cb3f6bd16ce683cb755f94c10fbd82",
- "reference": "1dd98b0564cb3f6bd16ce683cb755f94c10fbd82",
- "shasum": ""
- },
- "require": {
- "ext-json": "*",
- "guzzlehttp/promises": "^1.5",
- "guzzlehttp/psr7": "^1.9 || ^2.4",
- "php": "^7.2.5 || ^8.0",
- "psr/http-client": "^1.0",
- "symfony/deprecation-contracts": "^2.2 || ^3.0"
- },
- "provide": {
- "psr/http-client-implementation": "1.0"
- },
- "require-dev": {
- "bamarni/composer-bin-plugin": "^1.4.1",
- "ext-curl": "*",
- "php-http/client-integration-tests": "^3.0",
- "phpunit/phpunit": "^8.5.5 || ^9.3.5",
- "psr/log": "^1.1 || ^2.0 || ^3.0"
- },
- "suggest": {
- "ext-curl": "Required for CURL handler support",
- "ext-intl": "Required for Internationalized Domain Name (IDN) support",
- "psr/log": "Required for using the Log middleware"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "7.4-dev"
- }
- },
- "autoload": {
- "files": [
- "src/functions_include.php"
- ],
- "psr-4": {
- "GuzzleHttp\\": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Graham Campbell",
- "email": "hello@gjcampbell.co.uk",
- "homepage": "https://github.com/GrahamCampbell"
- },
- {
- "name": "Michael Dowling",
- "email": "mtdowling@gmail.com",
- "homepage": "https://github.com/mtdowling"
- },
- {
- "name": "Jeremy Lindblom",
- "email": "jeremeamia@gmail.com",
- "homepage": "https://github.com/jeremeamia"
- },
- {
- "name": "George Mponos",
- "email": "gmponos@gmail.com",
- "homepage": "https://github.com/gmponos"
- },
- {
- "name": "Tobias Nyholm",
- "email": "tobias.nyholm@gmail.com",
- "homepage": "https://github.com/Nyholm"
- },
- {
- "name": "Márk Sági-Kazár",
- "email": "mark.sagikazar@gmail.com",
- "homepage": "https://github.com/sagikazarmark"
- },
- {
- "name": "Tobias Schultze",
- "email": "webmaster@tubo-world.de",
- "homepage": "https://github.com/Tobion"
- }
- ],
- "description": "Guzzle is a PHP HTTP client library",
- "keywords": [
- "client",
- "curl",
- "framework",
- "http",
- "http client",
- "psr-18",
- "psr-7",
- "rest",
- "web service"
- ],
- "support": {
- "issues": "https://github.com/guzzle/guzzle/issues",
- "source": "https://github.com/guzzle/guzzle/tree/7.4.5"
- },
- "funding": [
- {
- "url": "https://github.com/GrahamCampbell",
- "type": "github"
- },
- {
- "url": "https://github.com/Nyholm",
- "type": "github"
- },
- {
- "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/guzzle",
- "type": "tidelift"
- }
- ],
- "time": "2022-06-20T22:16:13+00:00"
- },
- {
- "name": "guzzlehttp/promises",
- "version": "1.5.1",
- "source": {
- "type": "git",
- "url": "https://github.com/guzzle/promises.git",
- "reference": "fe752aedc9fd8fcca3fe7ad05d419d32998a06da"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/guzzle/promises/zipball/fe752aedc9fd8fcca3fe7ad05d419d32998a06da",
- "reference": "fe752aedc9fd8fcca3fe7ad05d419d32998a06da",
- "shasum": ""
- },
- "require": {
- "php": ">=5.5"
- },
- "require-dev": {
- "symfony/phpunit-bridge": "^4.4 || ^5.1"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "1.5-dev"
- }
- },
- "autoload": {
- "files": [
- "src/functions_include.php"
- ],
- "psr-4": {
- "GuzzleHttp\\Promise\\": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Graham Campbell",
- "email": "hello@gjcampbell.co.uk",
- "homepage": "https://github.com/GrahamCampbell"
- },
- {
- "name": "Michael Dowling",
- "email": "mtdowling@gmail.com",
- "homepage": "https://github.com/mtdowling"
- },
- {
- "name": "Tobias Nyholm",
- "email": "tobias.nyholm@gmail.com",
- "homepage": "https://github.com/Nyholm"
- },
- {
- "name": "Tobias Schultze",
- "email": "webmaster@tubo-world.de",
- "homepage": "https://github.com/Tobion"
- }
- ],
- "description": "Guzzle promises library",
- "keywords": [
- "promise"
- ],
- "support": {
- "issues": "https://github.com/guzzle/promises/issues",
- "source": "https://github.com/guzzle/promises/tree/1.5.1"
- },
- "funding": [
- {
- "url": "https://github.com/GrahamCampbell",
- "type": "github"
- },
- {
- "url": "https://github.com/Nyholm",
- "type": "github"
- },
- {
- "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/promises",
- "type": "tidelift"
- }
- ],
- "time": "2021-10-22T20:56:57+00:00"
- },
- {
- "name": "guzzlehttp/psr7",
- "version": "2.4.0",
- "source": {
- "type": "git",
- "url": "https://github.com/guzzle/psr7.git",
- "reference": "13388f00956b1503577598873fffb5ae994b5737"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/guzzle/psr7/zipball/13388f00956b1503577598873fffb5ae994b5737",
- "reference": "13388f00956b1503577598873fffb5ae994b5737",
- "shasum": ""
- },
- "require": {
- "php": "^7.2.5 || ^8.0",
- "psr/http-factory": "^1.0",
- "psr/http-message": "^1.0",
- "ralouphie/getallheaders": "^3.0"
- },
- "provide": {
- "psr/http-factory-implementation": "1.0",
- "psr/http-message-implementation": "1.0"
- },
- "require-dev": {
- "bamarni/composer-bin-plugin": "^1.4.1",
- "http-interop/http-factory-tests": "^0.9",
- "phpunit/phpunit": "^8.5.8 || ^9.3.10"
- },
- "suggest": {
- "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "2.4-dev"
- }
- },
- "autoload": {
- "psr-4": {
- "GuzzleHttp\\Psr7\\": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Graham Campbell",
- "email": "hello@gjcampbell.co.uk",
- "homepage": "https://github.com/GrahamCampbell"
- },
- {
- "name": "Michael Dowling",
- "email": "mtdowling@gmail.com",
- "homepage": "https://github.com/mtdowling"
- },
- {
- "name": "George Mponos",
- "email": "gmponos@gmail.com",
- "homepage": "https://github.com/gmponos"
- },
- {
- "name": "Tobias Nyholm",
- "email": "tobias.nyholm@gmail.com",
- "homepage": "https://github.com/Nyholm"
- },
- {
- "name": "Márk Sági-Kazár",
- "email": "mark.sagikazar@gmail.com",
- "homepage": "https://github.com/sagikazarmark"
- },
- {
- "name": "Tobias Schultze",
- "email": "webmaster@tubo-world.de",
- "homepage": "https://github.com/Tobion"
- },
- {
- "name": "Márk Sági-Kazár",
- "email": "mark.sagikazar@gmail.com",
- "homepage": "https://sagikazarmark.hu"
- }
- ],
- "description": "PSR-7 message implementation that also provides common utility methods",
- "keywords": [
- "http",
- "message",
- "psr-7",
- "request",
- "response",
- "stream",
- "uri",
- "url"
- ],
- "support": {
- "issues": "https://github.com/guzzle/psr7/issues",
- "source": "https://github.com/guzzle/psr7/tree/2.4.0"
- },
- "funding": [
- {
- "url": "https://github.com/GrahamCampbell",
- "type": "github"
- },
- {
- "url": "https://github.com/Nyholm",
- "type": "github"
- },
- {
- "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/psr7",
- "type": "tidelift"
- }
- ],
- "time": "2022-06-20T21:43:11+00:00"
- },
- {
- "name": "myclabs/deep-copy",
- "version": "1.11.0",
- "source": {
- "type": "git",
- "url": "https://github.com/myclabs/DeepCopy.git",
- "reference": "14daed4296fae74d9e3201d2c4925d1acb7aa614"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/14daed4296fae74d9e3201d2c4925d1acb7aa614",
- "reference": "14daed4296fae74d9e3201d2c4925d1acb7aa614",
- "shasum": ""
- },
- "require": {
- "php": "^7.1 || ^8.0"
- },
- "conflict": {
- "doctrine/collections": "<1.6.8",
- "doctrine/common": "<2.13.3 || >=3,<3.2.2"
- },
- "require-dev": {
- "doctrine/collections": "^1.6.8",
- "doctrine/common": "^2.13.3 || ^3.2.2",
- "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13"
- },
- "type": "library",
- "autoload": {
- "files": [
- "src/DeepCopy/deep_copy.php"
- ],
- "psr-4": {
- "DeepCopy\\": "src/DeepCopy/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "description": "Create deep copies (clones) of your objects",
- "keywords": [
- "clone",
- "copy",
- "duplicate",
- "object",
- "object graph"
- ],
- "support": {
- "issues": "https://github.com/myclabs/DeepCopy/issues",
- "source": "https://github.com/myclabs/DeepCopy/tree/1.11.0"
- },
- "funding": [
- {
- "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy",
- "type": "tidelift"
- }
- ],
- "time": "2022-03-03T13:19:32+00:00"
- },
- {
- "name": "nikic/php-parser",
- "version": "v4.13.2",
- "source": {
- "type": "git",
- "url": "https://github.com/nikic/PHP-Parser.git",
- "reference": "210577fe3cf7badcc5814d99455df46564f3c077"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/210577fe3cf7badcc5814d99455df46564f3c077",
- "reference": "210577fe3cf7badcc5814d99455df46564f3c077",
- "shasum": ""
- },
- "require": {
- "ext-tokenizer": "*",
- "php": ">=7.0"
- },
- "require-dev": {
- "ircmaxell/php-yacc": "^0.0.7",
- "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0"
- },
- "bin": [
- "bin/php-parse"
- ],
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "4.9-dev"
- }
- },
- "autoload": {
- "psr-4": {
- "PhpParser\\": "lib/PhpParser"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "BSD-3-Clause"
- ],
- "authors": [
- {
- "name": "Nikita Popov"
- }
- ],
- "description": "A PHP parser written in PHP",
- "keywords": [
- "parser",
- "php"
- ],
- "support": {
- "issues": "https://github.com/nikic/PHP-Parser/issues",
- "source": "https://github.com/nikic/PHP-Parser/tree/v4.13.2"
- },
- "time": "2021-11-30T19:35:32+00:00"
- },
- {
- "name": "phar-io/manifest",
- "version": "2.0.3",
- "source": {
- "type": "git",
- "url": "https://github.com/phar-io/manifest.git",
- "reference": "97803eca37d319dfa7826cc2437fc020857acb53"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/phar-io/manifest/zipball/97803eca37d319dfa7826cc2437fc020857acb53",
- "reference": "97803eca37d319dfa7826cc2437fc020857acb53",
- "shasum": ""
- },
- "require": {
- "ext-dom": "*",
- "ext-phar": "*",
- "ext-xmlwriter": "*",
- "phar-io/version": "^3.0.1",
- "php": "^7.2 || ^8.0"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "2.0.x-dev"
- }
- },
- "autoload": {
- "classmap": [
- "src/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "BSD-3-Clause"
- ],
- "authors": [
- {
- "name": "Arne Blankerts",
- "email": "arne@blankerts.de",
- "role": "Developer"
- },
- {
- "name": "Sebastian Heuer",
- "email": "sebastian@phpeople.de",
- "role": "Developer"
- },
- {
- "name": "Sebastian Bergmann",
- "email": "sebastian@phpunit.de",
- "role": "Developer"
- }
- ],
- "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)",
- "support": {
- "issues": "https://github.com/phar-io/manifest/issues",
- "source": "https://github.com/phar-io/manifest/tree/2.0.3"
- },
- "time": "2021-07-20T11:28:43+00:00"
- },
- {
- "name": "phar-io/version",
- "version": "3.2.1",
- "source": {
- "type": "git",
- "url": "https://github.com/phar-io/version.git",
- "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/phar-io/version/zipball/4f7fd7836c6f332bb2933569e566a0d6c4cbed74",
- "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74",
- "shasum": ""
- },
- "require": {
- "php": "^7.2 || ^8.0"
- },
- "type": "library",
- "autoload": {
- "classmap": [
- "src/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "BSD-3-Clause"
- ],
- "authors": [
- {
- "name": "Arne Blankerts",
- "email": "arne@blankerts.de",
- "role": "Developer"
- },
- {
- "name": "Sebastian Heuer",
- "email": "sebastian@phpeople.de",
- "role": "Developer"
- },
- {
- "name": "Sebastian Bergmann",
- "email": "sebastian@phpunit.de",
- "role": "Developer"
- }
- ],
- "description": "Library for handling version information and constraints",
- "support": {
- "issues": "https://github.com/phar-io/version/issues",
- "source": "https://github.com/phar-io/version/tree/3.2.1"
- },
- "time": "2022-02-21T01:04:05+00:00"
- },
- {
- "name": "php-coveralls/php-coveralls",
- "version": "v2.5.2",
- "source": {
- "type": "git",
- "url": "https://github.com/php-coveralls/php-coveralls.git",
- "reference": "007e13afdcdba2cd0efcc5f72c3b7efb356a8bd4"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/php-coveralls/php-coveralls/zipball/007e13afdcdba2cd0efcc5f72c3b7efb356a8bd4",
- "reference": "007e13afdcdba2cd0efcc5f72c3b7efb356a8bd4",
- "shasum": ""
- },
- "require": {
- "ext-json": "*",
- "ext-simplexml": "*",
- "guzzlehttp/guzzle": "^6.0 || ^7.0",
- "php": "^5.5 || ^7.0 || ^8.0",
- "psr/log": "^1.0 || ^2.0",
- "symfony/config": "^2.1 || ^3.0 || ^4.0 || ^5.0 || ^6.0",
- "symfony/console": "^2.1 || ^3.0 || ^4.0 || ^5.0 || ^6.0",
- "symfony/stopwatch": "^2.0 || ^3.0 || ^4.0 || ^5.0 || ^6.0",
- "symfony/yaml": "^2.0.5 || ^3.0 || ^4.0 || ^5.0 || ^6.0"
- },
- "require-dev": {
- "phpunit/phpunit": "^4.8.35 || ^5.4.3 || ^6.0 || ^7.0 || ^8.0 || ^9.0",
- "sanmai/phpunit-legacy-adapter": "^6.1 || ^8.0"
- },
- "suggest": {
- "symfony/http-kernel": "Allows Symfony integration"
- },
- "bin": [
- "bin/php-coveralls"
- ],
- "type": "library",
- "autoload": {
- "psr-4": {
- "PhpCoveralls\\": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Kitamura Satoshi",
- "email": "with.no.parachute@gmail.com",
- "homepage": "https://www.facebook.com/satooshi.jp",
- "role": "Original creator"
- },
- {
- "name": "Takashi Matsuo",
- "email": "tmatsuo@google.com"
- },
- {
- "name": "Google Inc"
- },
- {
- "name": "Dariusz Ruminski",
- "email": "dariusz.ruminski@gmail.com",
- "homepage": "https://github.com/keradus"
- },
- {
- "name": "Contributors",
- "homepage": "https://github.com/php-coveralls/php-coveralls/graphs/contributors"
- }
- ],
- "description": "PHP client library for Coveralls API",
- "homepage": "https://github.com/php-coveralls/php-coveralls",
- "keywords": [
- "ci",
- "coverage",
- "github",
- "test"
- ],
- "support": {
- "issues": "https://github.com/php-coveralls/php-coveralls/issues",
- "source": "https://github.com/php-coveralls/php-coveralls/tree/v2.5.2"
- },
- "time": "2021-12-06T17:05:08+00:00"
- },
- {
- "name": "phpdocumentor/reflection-common",
- "version": "2.2.0",
- "source": {
- "type": "git",
- "url": "https://github.com/phpDocumentor/ReflectionCommon.git",
- "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/1d01c49d4ed62f25aa84a747ad35d5a16924662b",
- "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b",
- "shasum": ""
- },
- "require": {
- "php": "^7.2 || ^8.0"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-2.x": "2.x-dev"
- }
- },
- "autoload": {
- "psr-4": {
- "phpDocumentor\\Reflection\\": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Jaap van Otterdijk",
- "email": "opensource@ijaap.nl"
- }
- ],
- "description": "Common reflection classes used by phpdocumentor to reflect the code structure",
- "homepage": "http://www.phpdoc.org",
- "keywords": [
- "FQSEN",
- "phpDocumentor",
- "phpdoc",
- "reflection",
- "static analysis"
- ],
- "support": {
- "issues": "https://github.com/phpDocumentor/ReflectionCommon/issues",
- "source": "https://github.com/phpDocumentor/ReflectionCommon/tree/2.x"
- },
- "time": "2020-06-27T09:03:43+00:00"
- },
- {
- "name": "phpdocumentor/reflection-docblock",
- "version": "5.3.0",
- "source": {
- "type": "git",
- "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git",
- "reference": "622548b623e81ca6d78b721c5e029f4ce664f170"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/622548b623e81ca6d78b721c5e029f4ce664f170",
- "reference": "622548b623e81ca6d78b721c5e029f4ce664f170",
- "shasum": ""
- },
- "require": {
- "ext-filter": "*",
- "php": "^7.2 || ^8.0",
- "phpdocumentor/reflection-common": "^2.2",
- "phpdocumentor/type-resolver": "^1.3",
- "webmozart/assert": "^1.9.1"
- },
- "require-dev": {
- "mockery/mockery": "~1.3.2",
- "psalm/phar": "^4.8"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "5.x-dev"
- }
- },
- "autoload": {
- "psr-4": {
- "phpDocumentor\\Reflection\\": "src"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Mike van Riel",
- "email": "me@mikevanriel.com"
- },
- {
- "name": "Jaap van Otterdijk",
- "email": "account@ijaap.nl"
- }
- ],
- "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.",
- "support": {
- "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues",
- "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.3.0"
- },
- "time": "2021-10-19T17:43:47+00:00"
- },
- {
- "name": "phpdocumentor/type-resolver",
- "version": "1.6.0",
- "source": {
- "type": "git",
- "url": "https://github.com/phpDocumentor/TypeResolver.git",
- "reference": "93ebd0014cab80c4ea9f5e297ea48672f1b87706"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/93ebd0014cab80c4ea9f5e297ea48672f1b87706",
- "reference": "93ebd0014cab80c4ea9f5e297ea48672f1b87706",
- "shasum": ""
- },
- "require": {
- "php": "^7.2 || ^8.0",
- "phpdocumentor/reflection-common": "^2.0"
- },
- "require-dev": {
- "ext-tokenizer": "*",
- "psalm/phar": "^4.8"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-1.x": "1.x-dev"
- }
- },
- "autoload": {
- "psr-4": {
- "phpDocumentor\\Reflection\\": "src"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Mike van Riel",
- "email": "me@mikevanriel.com"
- }
- ],
- "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names",
- "support": {
- "issues": "https://github.com/phpDocumentor/TypeResolver/issues",
- "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.6.0"
- },
- "time": "2022-01-04T19:58:01+00:00"
- },
- {
- "name": "phpspec/prophecy",
- "version": "v1.15.0",
- "source": {
- "type": "git",
- "url": "https://github.com/phpspec/prophecy.git",
- "reference": "bbcd7380b0ebf3961ee21409db7b38bc31d69a13"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/phpspec/prophecy/zipball/bbcd7380b0ebf3961ee21409db7b38bc31d69a13",
- "reference": "bbcd7380b0ebf3961ee21409db7b38bc31d69a13",
- "shasum": ""
- },
- "require": {
- "doctrine/instantiator": "^1.2",
- "php": "^7.2 || ~8.0, <8.2",
- "phpdocumentor/reflection-docblock": "^5.2",
- "sebastian/comparator": "^3.0 || ^4.0",
- "sebastian/recursion-context": "^3.0 || ^4.0"
- },
- "require-dev": {
- "phpspec/phpspec": "^6.0 || ^7.0",
- "phpunit/phpunit": "^8.0 || ^9.0"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "1.x-dev"
- }
- },
- "autoload": {
- "psr-4": {
- "Prophecy\\": "src/Prophecy"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Konstantin Kudryashov",
- "email": "ever.zet@gmail.com",
- "homepage": "http://everzet.com"
- },
- {
- "name": "Marcello Duarte",
- "email": "marcello.duarte@gmail.com"
- }
- ],
- "description": "Highly opinionated mocking framework for PHP 5.3+",
- "homepage": "https://github.com/phpspec/prophecy",
- "keywords": [
- "Double",
- "Dummy",
- "fake",
- "mock",
- "spy",
- "stub"
- ],
- "support": {
- "issues": "https://github.com/phpspec/prophecy/issues",
- "source": "https://github.com/phpspec/prophecy/tree/v1.15.0"
- },
- "time": "2021-12-08T12:19:24+00:00"
- },
- {
- "name": "phpstan/phpstan",
- "version": "1.5.0",
- "source": {
- "type": "git",
- "url": "https://github.com/phpstan/phpstan.git",
- "reference": "2be8dd6dfa09ab1a21c49956ff591979cd5ab29e"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/phpstan/phpstan/zipball/2be8dd6dfa09ab1a21c49956ff591979cd5ab29e",
- "reference": "2be8dd6dfa09ab1a21c49956ff591979cd5ab29e",
- "shasum": ""
- },
- "require": {
- "php": "^7.2|^8.0"
- },
- "conflict": {
- "phpstan/phpstan-shim": "*"
- },
- "bin": [
- "phpstan",
- "phpstan.phar"
- ],
- "type": "library",
- "autoload": {
- "files": [
- "bootstrap.php"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "description": "PHPStan - PHP Static Analysis Tool",
- "support": {
- "issues": "https://github.com/phpstan/phpstan/issues",
- "source": "https://github.com/phpstan/phpstan/tree/1.5.0"
- },
- "funding": [
- {
- "url": "https://github.com/ondrejmirtes",
- "type": "github"
- },
- {
- "url": "https://github.com/phpstan",
- "type": "github"
- },
- {
- "url": "https://www.patreon.com/phpstan",
- "type": "patreon"
- },
- {
- "url": "https://tidelift.com/funding/github/packagist/phpstan/phpstan",
- "type": "tidelift"
- }
- ],
- "time": "2022-03-24T18:18:00+00:00"
- },
- {
- "name": "phpunit/php-code-coverage",
- "version": "9.2.15",
- "source": {
- "type": "git",
- "url": "https://github.com/sebastianbergmann/php-code-coverage.git",
- "reference": "2e9da11878c4202f97915c1cb4bb1ca318a63f5f"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/2e9da11878c4202f97915c1cb4bb1ca318a63f5f",
- "reference": "2e9da11878c4202f97915c1cb4bb1ca318a63f5f",
- "shasum": ""
- },
- "require": {
- "ext-dom": "*",
- "ext-libxml": "*",
- "ext-xmlwriter": "*",
- "nikic/php-parser": "^4.13.0",
- "php": ">=7.3",
- "phpunit/php-file-iterator": "^3.0.3",
- "phpunit/php-text-template": "^2.0.2",
- "sebastian/code-unit-reverse-lookup": "^2.0.2",
- "sebastian/complexity": "^2.0",
- "sebastian/environment": "^5.1.2",
- "sebastian/lines-of-code": "^1.0.3",
- "sebastian/version": "^3.0.1",
- "theseer/tokenizer": "^1.2.0"
- },
- "require-dev": {
- "phpunit/phpunit": "^9.3"
- },
- "suggest": {
- "ext-pcov": "*",
- "ext-xdebug": "*"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "9.2-dev"
- }
- },
- "autoload": {
- "classmap": [
- "src/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "BSD-3-Clause"
- ],
- "authors": [
- {
- "name": "Sebastian Bergmann",
- "email": "sebastian@phpunit.de",
- "role": "lead"
- }
- ],
- "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.",
- "homepage": "https://github.com/sebastianbergmann/php-code-coverage",
- "keywords": [
- "coverage",
- "testing",
- "xunit"
- ],
- "support": {
- "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues",
- "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.15"
- },
- "funding": [
- {
- "url": "https://github.com/sebastianbergmann",
- "type": "github"
- }
- ],
- "time": "2022-03-07T09:28:20+00:00"
- },
- {
- "name": "phpunit/php-file-iterator",
- "version": "3.0.6",
- "source": {
- "type": "git",
- "url": "https://github.com/sebastianbergmann/php-file-iterator.git",
- "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf",
- "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf",
- "shasum": ""
- },
- "require": {
- "php": ">=7.3"
- },
- "require-dev": {
- "phpunit/phpunit": "^9.3"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "3.0-dev"
- }
- },
- "autoload": {
- "classmap": [
- "src/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "BSD-3-Clause"
- ],
- "authors": [
- {
- "name": "Sebastian Bergmann",
- "email": "sebastian@phpunit.de",
- "role": "lead"
- }
- ],
- "description": "FilterIterator implementation that filters files based on a list of suffixes.",
- "homepage": "https://github.com/sebastianbergmann/php-file-iterator/",
- "keywords": [
- "filesystem",
- "iterator"
- ],
- "support": {
- "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues",
- "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.6"
- },
- "funding": [
- {
- "url": "https://github.com/sebastianbergmann",
- "type": "github"
- }
- ],
- "time": "2021-12-02T12:48:52+00:00"
- },
- {
- "name": "phpunit/php-invoker",
- "version": "3.1.1",
- "source": {
- "type": "git",
- "url": "https://github.com/sebastianbergmann/php-invoker.git",
- "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/5a10147d0aaf65b58940a0b72f71c9ac0423cc67",
- "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67",
- "shasum": ""
- },
- "require": {
- "php": ">=7.3"
- },
- "require-dev": {
- "ext-pcntl": "*",
- "phpunit/phpunit": "^9.3"
- },
- "suggest": {
- "ext-pcntl": "*"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "3.1-dev"
- }
- },
- "autoload": {
- "classmap": [
- "src/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "BSD-3-Clause"
- ],
- "authors": [
- {
- "name": "Sebastian Bergmann",
- "email": "sebastian@phpunit.de",
- "role": "lead"
- }
- ],
- "description": "Invoke callables with a timeout",
- "homepage": "https://github.com/sebastianbergmann/php-invoker/",
- "keywords": [
- "process"
- ],
- "support": {
- "issues": "https://github.com/sebastianbergmann/php-invoker/issues",
- "source": "https://github.com/sebastianbergmann/php-invoker/tree/3.1.1"
- },
- "funding": [
- {
- "url": "https://github.com/sebastianbergmann",
- "type": "github"
- }
- ],
- "time": "2020-09-28T05:58:55+00:00"
- },
- {
- "name": "phpunit/php-text-template",
- "version": "2.0.4",
- "source": {
- "type": "git",
- "url": "https://github.com/sebastianbergmann/php-text-template.git",
- "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28",
- "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28",
- "shasum": ""
- },
- "require": {
- "php": ">=7.3"
- },
- "require-dev": {
- "phpunit/phpunit": "^9.3"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "2.0-dev"
- }
- },
- "autoload": {
- "classmap": [
- "src/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "BSD-3-Clause"
- ],
- "authors": [
- {
- "name": "Sebastian Bergmann",
- "email": "sebastian@phpunit.de",
- "role": "lead"
- }
- ],
- "description": "Simple template engine.",
- "homepage": "https://github.com/sebastianbergmann/php-text-template/",
- "keywords": [
- "template"
- ],
- "support": {
- "issues": "https://github.com/sebastianbergmann/php-text-template/issues",
- "source": "https://github.com/sebastianbergmann/php-text-template/tree/2.0.4"
- },
- "funding": [
- {
- "url": "https://github.com/sebastianbergmann",
- "type": "github"
- }
- ],
- "time": "2020-10-26T05:33:50+00:00"
- },
- {
- "name": "phpunit/php-timer",
- "version": "5.0.3",
- "source": {
- "type": "git",
- "url": "https://github.com/sebastianbergmann/php-timer.git",
- "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2",
- "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2",
- "shasum": ""
- },
- "require": {
- "php": ">=7.3"
- },
- "require-dev": {
- "phpunit/phpunit": "^9.3"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "5.0-dev"
- }
- },
- "autoload": {
- "classmap": [
- "src/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "BSD-3-Clause"
- ],
- "authors": [
- {
- "name": "Sebastian Bergmann",
- "email": "sebastian@phpunit.de",
- "role": "lead"
- }
- ],
- "description": "Utility class for timing",
- "homepage": "https://github.com/sebastianbergmann/php-timer/",
- "keywords": [
- "timer"
- ],
- "support": {
- "issues": "https://github.com/sebastianbergmann/php-timer/issues",
- "source": "https://github.com/sebastianbergmann/php-timer/tree/5.0.3"
- },
- "funding": [
- {
- "url": "https://github.com/sebastianbergmann",
- "type": "github"
- }
- ],
- "time": "2020-10-26T13:16:10+00:00"
- },
- {
- "name": "phpunit/phpunit",
- "version": "9.5.19",
- "source": {
- "type": "git",
- "url": "https://github.com/sebastianbergmann/phpunit.git",
- "reference": "35ea4b7f3acabb26f4bb640f8c30866c401da807"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/35ea4b7f3acabb26f4bb640f8c30866c401da807",
- "reference": "35ea4b7f3acabb26f4bb640f8c30866c401da807",
- "shasum": ""
- },
- "require": {
- "doctrine/instantiator": "^1.3.1",
- "ext-dom": "*",
- "ext-json": "*",
- "ext-libxml": "*",
- "ext-mbstring": "*",
- "ext-xml": "*",
- "ext-xmlwriter": "*",
- "myclabs/deep-copy": "^1.10.1",
- "phar-io/manifest": "^2.0.3",
- "phar-io/version": "^3.0.2",
- "php": ">=7.3",
- "phpspec/prophecy": "^1.12.1",
- "phpunit/php-code-coverage": "^9.2.13",
- "phpunit/php-file-iterator": "^3.0.5",
- "phpunit/php-invoker": "^3.1.1",
- "phpunit/php-text-template": "^2.0.3",
- "phpunit/php-timer": "^5.0.2",
- "sebastian/cli-parser": "^1.0.1",
- "sebastian/code-unit": "^1.0.6",
- "sebastian/comparator": "^4.0.5",
- "sebastian/diff": "^4.0.3",
- "sebastian/environment": "^5.1.3",
- "sebastian/exporter": "^4.0.3",
- "sebastian/global-state": "^5.0.1",
- "sebastian/object-enumerator": "^4.0.3",
- "sebastian/resource-operations": "^3.0.3",
- "sebastian/type": "^3.0",
- "sebastian/version": "^3.0.2"
- },
- "require-dev": {
- "ext-pdo": "*",
- "phpspec/prophecy-phpunit": "^2.0.1"
- },
- "suggest": {
- "ext-soap": "*",
- "ext-xdebug": "*"
- },
- "bin": [
- "phpunit"
- ],
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "9.5-dev"
- }
- },
- "autoload": {
- "files": [
- "src/Framework/Assert/Functions.php"
- ],
- "classmap": [
- "src/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "BSD-3-Clause"
- ],
- "authors": [
- {
- "name": "Sebastian Bergmann",
- "email": "sebastian@phpunit.de",
- "role": "lead"
- }
- ],
- "description": "The PHP Unit Testing framework.",
- "homepage": "https://phpunit.de/",
- "keywords": [
- "phpunit",
- "testing",
- "xunit"
- ],
- "support": {
- "issues": "https://github.com/sebastianbergmann/phpunit/issues",
- "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.19"
- },
- "funding": [
- {
- "url": "https://phpunit.de/sponsors.html",
- "type": "custom"
- },
- {
- "url": "https://github.com/sebastianbergmann",
- "type": "github"
- }
- ],
- "time": "2022-03-15T09:57:31+00:00"
- },
- {
- "name": "psr/http-client",
- "version": "1.0.1",
- "source": {
- "type": "git",
- "url": "https://github.com/php-fig/http-client.git",
- "reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/php-fig/http-client/zipball/2dfb5f6c5eff0e91e20e913f8c5452ed95b86621",
- "reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621",
- "shasum": ""
- },
- "require": {
- "php": "^7.0 || ^8.0",
- "psr/http-message": "^1.0"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "1.0.x-dev"
- }
- },
- "autoload": {
- "psr-4": {
- "Psr\\Http\\Client\\": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "PHP-FIG",
- "homepage": "http://www.php-fig.org/"
- }
- ],
- "description": "Common interface for HTTP clients",
- "homepage": "https://github.com/php-fig/http-client",
- "keywords": [
- "http",
- "http-client",
- "psr",
- "psr-18"
- ],
- "support": {
- "source": "https://github.com/php-fig/http-client/tree/master"
- },
- "time": "2020-06-29T06:28:15+00:00"
- },
- {
- "name": "psr/http-factory",
- "version": "1.0.1",
- "source": {
- "type": "git",
- "url": "https://github.com/php-fig/http-factory.git",
- "reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/php-fig/http-factory/zipball/12ac7fcd07e5b077433f5f2bee95b3a771bf61be",
- "reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be",
- "shasum": ""
- },
- "require": {
- "php": ">=7.0.0",
- "psr/http-message": "^1.0"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "1.0.x-dev"
- }
- },
- "autoload": {
- "psr-4": {
- "Psr\\Http\\Message\\": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "PHP-FIG",
- "homepage": "http://www.php-fig.org/"
- }
- ],
- "description": "Common interfaces for PSR-7 HTTP message factories",
- "keywords": [
- "factory",
- "http",
- "message",
- "psr",
- "psr-17",
- "psr-7",
- "request",
- "response"
- ],
- "support": {
- "source": "https://github.com/php-fig/http-factory/tree/master"
- },
- "time": "2019-04-30T12:38:16+00:00"
- },
- {
- "name": "psr/http-message",
- "version": "1.0.1",
- "source": {
- "type": "git",
- "url": "https://github.com/php-fig/http-message.git",
- "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363",
- "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363",
- "shasum": ""
- },
- "require": {
- "php": ">=5.3.0"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "1.0.x-dev"
- }
- },
- "autoload": {
- "psr-4": {
- "Psr\\Http\\Message\\": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "PHP-FIG",
- "homepage": "http://www.php-fig.org/"
- }
- ],
- "description": "Common interface for HTTP messages",
- "homepage": "https://github.com/php-fig/http-message",
- "keywords": [
- "http",
- "http-message",
- "psr",
- "psr-7",
- "request",
- "response"
- ],
- "support": {
- "source": "https://github.com/php-fig/http-message/tree/master"
- },
- "time": "2016-08-06T14:39:51+00:00"
- },
- {
- "name": "psr/log",
- "version": "2.0.0",
- "source": {
- "type": "git",
- "url": "https://github.com/php-fig/log.git",
- "reference": "ef29f6d262798707a9edd554e2b82517ef3a9376"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/php-fig/log/zipball/ef29f6d262798707a9edd554e2b82517ef3a9376",
- "reference": "ef29f6d262798707a9edd554e2b82517ef3a9376",
- "shasum": ""
- },
- "require": {
- "php": ">=8.0.0"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "2.0.x-dev"
- }
- },
- "autoload": {
- "psr-4": {
- "Psr\\Log\\": "src"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "PHP-FIG",
- "homepage": "https://www.php-fig.org/"
- }
- ],
- "description": "Common interface for logging libraries",
- "homepage": "https://github.com/php-fig/log",
- "keywords": [
- "log",
- "psr",
- "psr-3"
- ],
- "support": {
- "source": "https://github.com/php-fig/log/tree/2.0.0"
- },
- "time": "2021-07-14T16:41:46+00:00"
- },
- {
- "name": "ralouphie/getallheaders",
- "version": "3.0.3",
- "source": {
- "type": "git",
- "url": "https://github.com/ralouphie/getallheaders.git",
- "reference": "120b605dfeb996808c31b6477290a714d356e822"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822",
- "reference": "120b605dfeb996808c31b6477290a714d356e822",
- "shasum": ""
- },
- "require": {
- "php": ">=5.6"
- },
- "require-dev": {
- "php-coveralls/php-coveralls": "^2.1",
- "phpunit/phpunit": "^5 || ^6.5"
- },
- "type": "library",
- "autoload": {
- "files": [
- "src/getallheaders.php"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Ralph Khattar",
- "email": "ralph.khattar@gmail.com"
- }
- ],
- "description": "A polyfill for getallheaders.",
- "support": {
- "issues": "https://github.com/ralouphie/getallheaders/issues",
- "source": "https://github.com/ralouphie/getallheaders/tree/develop"
- },
- "time": "2019-03-08T08:55:37+00:00"
- },
- {
- "name": "sebastian/cli-parser",
- "version": "1.0.1",
- "source": {
- "type": "git",
- "url": "https://github.com/sebastianbergmann/cli-parser.git",
- "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/442e7c7e687e42adc03470c7b668bc4b2402c0b2",
- "reference": "442e7c7e687e42adc03470c7b668bc4b2402c0b2",
- "shasum": ""
- },
- "require": {
- "php": ">=7.3"
- },
- "require-dev": {
- "phpunit/phpunit": "^9.3"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "1.0-dev"
- }
- },
- "autoload": {
- "classmap": [
- "src/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "BSD-3-Clause"
- ],
- "authors": [
- {
- "name": "Sebastian Bergmann",
- "email": "sebastian@phpunit.de",
- "role": "lead"
- }
- ],
- "description": "Library for parsing CLI options",
- "homepage": "https://github.com/sebastianbergmann/cli-parser",
- "support": {
- "issues": "https://github.com/sebastianbergmann/cli-parser/issues",
- "source": "https://github.com/sebastianbergmann/cli-parser/tree/1.0.1"
- },
- "funding": [
- {
- "url": "https://github.com/sebastianbergmann",
- "type": "github"
- }
- ],
- "time": "2020-09-28T06:08:49+00:00"
- },
- {
- "name": "sebastian/code-unit",
- "version": "1.0.8",
- "source": {
- "type": "git",
- "url": "https://github.com/sebastianbergmann/code-unit.git",
- "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/1fc9f64c0927627ef78ba436c9b17d967e68e120",
- "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120",
- "shasum": ""
- },
- "require": {
- "php": ">=7.3"
- },
- "require-dev": {
- "phpunit/phpunit": "^9.3"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "1.0-dev"
- }
- },
- "autoload": {
- "classmap": [
- "src/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "BSD-3-Clause"
- ],
- "authors": [
- {
- "name": "Sebastian Bergmann",
- "email": "sebastian@phpunit.de",
- "role": "lead"
- }
- ],
- "description": "Collection of value objects that represent the PHP code units",
- "homepage": "https://github.com/sebastianbergmann/code-unit",
- "support": {
- "issues": "https://github.com/sebastianbergmann/code-unit/issues",
- "source": "https://github.com/sebastianbergmann/code-unit/tree/1.0.8"
- },
- "funding": [
- {
- "url": "https://github.com/sebastianbergmann",
- "type": "github"
- }
- ],
- "time": "2020-10-26T13:08:54+00:00"
- },
- {
- "name": "sebastian/code-unit-reverse-lookup",
- "version": "2.0.3",
- "source": {
- "type": "git",
- "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git",
- "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5",
- "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5",
- "shasum": ""
- },
- "require": {
- "php": ">=7.3"
- },
- "require-dev": {
- "phpunit/phpunit": "^9.3"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "2.0-dev"
- }
- },
- "autoload": {
- "classmap": [
- "src/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "BSD-3-Clause"
- ],
- "authors": [
- {
- "name": "Sebastian Bergmann",
- "email": "sebastian@phpunit.de"
- }
- ],
- "description": "Looks up which function or method a line of code belongs to",
- "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/",
- "support": {
- "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues",
- "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/2.0.3"
- },
- "funding": [
- {
- "url": "https://github.com/sebastianbergmann",
- "type": "github"
- }
- ],
- "time": "2020-09-28T05:30:19+00:00"
- },
- {
- "name": "sebastian/comparator",
- "version": "4.0.6",
- "source": {
- "type": "git",
- "url": "https://github.com/sebastianbergmann/comparator.git",
- "reference": "55f4261989e546dc112258c7a75935a81a7ce382"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/55f4261989e546dc112258c7a75935a81a7ce382",
- "reference": "55f4261989e546dc112258c7a75935a81a7ce382",
- "shasum": ""
- },
- "require": {
- "php": ">=7.3",
- "sebastian/diff": "^4.0",
- "sebastian/exporter": "^4.0"
- },
- "require-dev": {
- "phpunit/phpunit": "^9.3"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "4.0-dev"
- }
- },
- "autoload": {
- "classmap": [
- "src/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "BSD-3-Clause"
- ],
- "authors": [
- {
- "name": "Sebastian Bergmann",
- "email": "sebastian@phpunit.de"
- },
- {
- "name": "Jeff Welch",
- "email": "whatthejeff@gmail.com"
- },
- {
- "name": "Volker Dusch",
- "email": "github@wallbash.com"
- },
- {
- "name": "Bernhard Schussek",
- "email": "bschussek@2bepublished.at"
- }
- ],
- "description": "Provides the functionality to compare PHP values for equality",
- "homepage": "https://github.com/sebastianbergmann/comparator",
- "keywords": [
- "comparator",
- "compare",
- "equality"
- ],
- "support": {
- "issues": "https://github.com/sebastianbergmann/comparator/issues",
- "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.6"
- },
- "funding": [
- {
- "url": "https://github.com/sebastianbergmann",
- "type": "github"
- }
- ],
- "time": "2020-10-26T15:49:45+00:00"
- },
- {
- "name": "sebastian/complexity",
- "version": "2.0.2",
- "source": {
- "type": "git",
- "url": "https://github.com/sebastianbergmann/complexity.git",
- "reference": "739b35e53379900cc9ac327b2147867b8b6efd88"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/739b35e53379900cc9ac327b2147867b8b6efd88",
- "reference": "739b35e53379900cc9ac327b2147867b8b6efd88",
- "shasum": ""
- },
- "require": {
- "nikic/php-parser": "^4.7",
- "php": ">=7.3"
- },
- "require-dev": {
- "phpunit/phpunit": "^9.3"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "2.0-dev"
- }
- },
- "autoload": {
- "classmap": [
- "src/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "BSD-3-Clause"
- ],
- "authors": [
- {
- "name": "Sebastian Bergmann",
- "email": "sebastian@phpunit.de",
- "role": "lead"
- }
- ],
- "description": "Library for calculating the complexity of PHP code units",
- "homepage": "https://github.com/sebastianbergmann/complexity",
- "support": {
- "issues": "https://github.com/sebastianbergmann/complexity/issues",
- "source": "https://github.com/sebastianbergmann/complexity/tree/2.0.2"
- },
- "funding": [
- {
- "url": "https://github.com/sebastianbergmann",
- "type": "github"
- }
- ],
- "time": "2020-10-26T15:52:27+00:00"
- },
- {
- "name": "sebastian/diff",
- "version": "4.0.4",
- "source": {
- "type": "git",
- "url": "https://github.com/sebastianbergmann/diff.git",
- "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/3461e3fccc7cfdfc2720be910d3bd73c69be590d",
- "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d",
- "shasum": ""
- },
- "require": {
- "php": ">=7.3"
- },
- "require-dev": {
- "phpunit/phpunit": "^9.3",
- "symfony/process": "^4.2 || ^5"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "4.0-dev"
- }
- },
- "autoload": {
- "classmap": [
- "src/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "BSD-3-Clause"
- ],
- "authors": [
- {
- "name": "Sebastian Bergmann",
- "email": "sebastian@phpunit.de"
- },
- {
- "name": "Kore Nordmann",
- "email": "mail@kore-nordmann.de"
- }
- ],
- "description": "Diff implementation",
- "homepage": "https://github.com/sebastianbergmann/diff",
- "keywords": [
- "diff",
- "udiff",
- "unidiff",
- "unified diff"
- ],
- "support": {
- "issues": "https://github.com/sebastianbergmann/diff/issues",
- "source": "https://github.com/sebastianbergmann/diff/tree/4.0.4"
- },
- "funding": [
- {
- "url": "https://github.com/sebastianbergmann",
- "type": "github"
- }
- ],
- "time": "2020-10-26T13:10:38+00:00"
- },
- {
- "name": "sebastian/environment",
- "version": "5.1.3",
- "source": {
- "type": "git",
- "url": "https://github.com/sebastianbergmann/environment.git",
- "reference": "388b6ced16caa751030f6a69e588299fa09200ac"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/388b6ced16caa751030f6a69e588299fa09200ac",
- "reference": "388b6ced16caa751030f6a69e588299fa09200ac",
- "shasum": ""
- },
- "require": {
- "php": ">=7.3"
- },
- "require-dev": {
- "phpunit/phpunit": "^9.3"
- },
- "suggest": {
- "ext-posix": "*"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "5.1-dev"
- }
- },
- "autoload": {
- "classmap": [
- "src/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "BSD-3-Clause"
- ],
- "authors": [
- {
- "name": "Sebastian Bergmann",
- "email": "sebastian@phpunit.de"
- }
- ],
- "description": "Provides functionality to handle HHVM/PHP environments",
- "homepage": "http://www.github.com/sebastianbergmann/environment",
- "keywords": [
- "Xdebug",
- "environment",
- "hhvm"
- ],
- "support": {
- "issues": "https://github.com/sebastianbergmann/environment/issues",
- "source": "https://github.com/sebastianbergmann/environment/tree/5.1.3"
- },
- "funding": [
- {
- "url": "https://github.com/sebastianbergmann",
- "type": "github"
- }
- ],
- "time": "2020-09-28T05:52:38+00:00"
- },
- {
- "name": "sebastian/exporter",
- "version": "4.0.4",
- "source": {
- "type": "git",
- "url": "https://github.com/sebastianbergmann/exporter.git",
- "reference": "65e8b7db476c5dd267e65eea9cab77584d3cfff9"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/65e8b7db476c5dd267e65eea9cab77584d3cfff9",
- "reference": "65e8b7db476c5dd267e65eea9cab77584d3cfff9",
- "shasum": ""
- },
- "require": {
- "php": ">=7.3",
- "sebastian/recursion-context": "^4.0"
- },
- "require-dev": {
- "ext-mbstring": "*",
- "phpunit/phpunit": "^9.3"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "4.0-dev"
- }
- },
- "autoload": {
- "classmap": [
- "src/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "BSD-3-Clause"
- ],
- "authors": [
- {
- "name": "Sebastian Bergmann",
- "email": "sebastian@phpunit.de"
- },
- {
- "name": "Jeff Welch",
- "email": "whatthejeff@gmail.com"
- },
- {
- "name": "Volker Dusch",
- "email": "github@wallbash.com"
- },
- {
- "name": "Adam Harvey",
- "email": "aharvey@php.net"
- },
- {
- "name": "Bernhard Schussek",
- "email": "bschussek@gmail.com"
- }
- ],
- "description": "Provides the functionality to export PHP variables for visualization",
- "homepage": "https://www.github.com/sebastianbergmann/exporter",
- "keywords": [
- "export",
- "exporter"
- ],
- "support": {
- "issues": "https://github.com/sebastianbergmann/exporter/issues",
- "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.4"
- },
- "funding": [
- {
- "url": "https://github.com/sebastianbergmann",
- "type": "github"
- }
- ],
- "time": "2021-11-11T14:18:36+00:00"
- },
- {
- "name": "sebastian/global-state",
- "version": "5.0.5",
- "source": {
- "type": "git",
- "url": "https://github.com/sebastianbergmann/global-state.git",
- "reference": "0ca8db5a5fc9c8646244e629625ac486fa286bf2"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/0ca8db5a5fc9c8646244e629625ac486fa286bf2",
- "reference": "0ca8db5a5fc9c8646244e629625ac486fa286bf2",
- "shasum": ""
- },
- "require": {
- "php": ">=7.3",
- "sebastian/object-reflector": "^2.0",
- "sebastian/recursion-context": "^4.0"
- },
- "require-dev": {
- "ext-dom": "*",
- "phpunit/phpunit": "^9.3"
- },
- "suggest": {
- "ext-uopz": "*"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "5.0-dev"
- }
- },
- "autoload": {
- "classmap": [
- "src/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "BSD-3-Clause"
- ],
- "authors": [
- {
- "name": "Sebastian Bergmann",
- "email": "sebastian@phpunit.de"
- }
- ],
- "description": "Snapshotting of global state",
- "homepage": "http://www.github.com/sebastianbergmann/global-state",
- "keywords": [
- "global state"
- ],
- "support": {
- "issues": "https://github.com/sebastianbergmann/global-state/issues",
- "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.5"
- },
- "funding": [
- {
- "url": "https://github.com/sebastianbergmann",
- "type": "github"
- }
- ],
- "time": "2022-02-14T08:28:10+00:00"
- },
- {
- "name": "sebastian/lines-of-code",
- "version": "1.0.3",
- "source": {
- "type": "git",
- "url": "https://github.com/sebastianbergmann/lines-of-code.git",
- "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/c1c2e997aa3146983ed888ad08b15470a2e22ecc",
- "reference": "c1c2e997aa3146983ed888ad08b15470a2e22ecc",
- "shasum": ""
- },
- "require": {
- "nikic/php-parser": "^4.6",
- "php": ">=7.3"
- },
- "require-dev": {
- "phpunit/phpunit": "^9.3"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "1.0-dev"
- }
- },
- "autoload": {
- "classmap": [
- "src/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "BSD-3-Clause"
- ],
- "authors": [
- {
- "name": "Sebastian Bergmann",
- "email": "sebastian@phpunit.de",
- "role": "lead"
- }
- ],
- "description": "Library for counting the lines of code in PHP source code",
- "homepage": "https://github.com/sebastianbergmann/lines-of-code",
- "support": {
- "issues": "https://github.com/sebastianbergmann/lines-of-code/issues",
- "source": "https://github.com/sebastianbergmann/lines-of-code/tree/1.0.3"
- },
- "funding": [
- {
- "url": "https://github.com/sebastianbergmann",
- "type": "github"
- }
- ],
- "time": "2020-11-28T06:42:11+00:00"
- },
- {
- "name": "sebastian/object-enumerator",
- "version": "4.0.4",
- "source": {
- "type": "git",
- "url": "https://github.com/sebastianbergmann/object-enumerator.git",
- "reference": "5c9eeac41b290a3712d88851518825ad78f45c71"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/5c9eeac41b290a3712d88851518825ad78f45c71",
- "reference": "5c9eeac41b290a3712d88851518825ad78f45c71",
- "shasum": ""
- },
- "require": {
- "php": ">=7.3",
- "sebastian/object-reflector": "^2.0",
- "sebastian/recursion-context": "^4.0"
- },
- "require-dev": {
- "phpunit/phpunit": "^9.3"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "4.0-dev"
- }
- },
- "autoload": {
- "classmap": [
- "src/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "BSD-3-Clause"
- ],
- "authors": [
- {
- "name": "Sebastian Bergmann",
- "email": "sebastian@phpunit.de"
- }
- ],
- "description": "Traverses array structures and object graphs to enumerate all referenced objects",
- "homepage": "https://github.com/sebastianbergmann/object-enumerator/",
- "support": {
- "issues": "https://github.com/sebastianbergmann/object-enumerator/issues",
- "source": "https://github.com/sebastianbergmann/object-enumerator/tree/4.0.4"
- },
- "funding": [
- {
- "url": "https://github.com/sebastianbergmann",
- "type": "github"
- }
- ],
- "time": "2020-10-26T13:12:34+00:00"
- },
- {
- "name": "sebastian/object-reflector",
- "version": "2.0.4",
- "source": {
- "type": "git",
- "url": "https://github.com/sebastianbergmann/object-reflector.git",
- "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/b4f479ebdbf63ac605d183ece17d8d7fe49c15c7",
- "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7",
- "shasum": ""
- },
- "require": {
- "php": ">=7.3"
- },
- "require-dev": {
- "phpunit/phpunit": "^9.3"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "2.0-dev"
- }
- },
- "autoload": {
- "classmap": [
- "src/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "BSD-3-Clause"
- ],
- "authors": [
- {
- "name": "Sebastian Bergmann",
- "email": "sebastian@phpunit.de"
- }
- ],
- "description": "Allows reflection of object attributes, including inherited and non-public ones",
- "homepage": "https://github.com/sebastianbergmann/object-reflector/",
- "support": {
- "issues": "https://github.com/sebastianbergmann/object-reflector/issues",
- "source": "https://github.com/sebastianbergmann/object-reflector/tree/2.0.4"
- },
- "funding": [
- {
- "url": "https://github.com/sebastianbergmann",
- "type": "github"
- }
- ],
- "time": "2020-10-26T13:14:26+00:00"
- },
- {
- "name": "sebastian/recursion-context",
- "version": "4.0.4",
- "source": {
- "type": "git",
- "url": "https://github.com/sebastianbergmann/recursion-context.git",
- "reference": "cd9d8cf3c5804de4341c283ed787f099f5506172"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/cd9d8cf3c5804de4341c283ed787f099f5506172",
- "reference": "cd9d8cf3c5804de4341c283ed787f099f5506172",
- "shasum": ""
- },
- "require": {
- "php": ">=7.3"
- },
- "require-dev": {
- "phpunit/phpunit": "^9.3"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "4.0-dev"
- }
- },
- "autoload": {
- "classmap": [
- "src/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "BSD-3-Clause"
- ],
- "authors": [
- {
- "name": "Sebastian Bergmann",
- "email": "sebastian@phpunit.de"
- },
- {
- "name": "Jeff Welch",
- "email": "whatthejeff@gmail.com"
- },
- {
- "name": "Adam Harvey",
- "email": "aharvey@php.net"
- }
- ],
- "description": "Provides functionality to recursively process PHP variables",
- "homepage": "http://www.github.com/sebastianbergmann/recursion-context",
- "support": {
- "issues": "https://github.com/sebastianbergmann/recursion-context/issues",
- "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.4"
- },
- "funding": [
- {
- "url": "https://github.com/sebastianbergmann",
- "type": "github"
- }
- ],
- "time": "2020-10-26T13:17:30+00:00"
- },
- {
- "name": "sebastian/resource-operations",
- "version": "3.0.3",
- "source": {
- "type": "git",
- "url": "https://github.com/sebastianbergmann/resource-operations.git",
- "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8",
- "reference": "0f4443cb3a1d92ce809899753bc0d5d5a8dd19a8",
- "shasum": ""
- },
- "require": {
- "php": ">=7.3"
- },
- "require-dev": {
- "phpunit/phpunit": "^9.0"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "3.0-dev"
- }
- },
- "autoload": {
- "classmap": [
- "src/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "BSD-3-Clause"
- ],
- "authors": [
- {
- "name": "Sebastian Bergmann",
- "email": "sebastian@phpunit.de"
- }
- ],
- "description": "Provides a list of PHP built-in functions that operate on resources",
- "homepage": "https://www.github.com/sebastianbergmann/resource-operations",
- "support": {
- "issues": "https://github.com/sebastianbergmann/resource-operations/issues",
- "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.3"
- },
- "funding": [
- {
- "url": "https://github.com/sebastianbergmann",
- "type": "github"
- }
- ],
- "time": "2020-09-28T06:45:17+00:00"
- },
- {
- "name": "sebastian/type",
- "version": "3.0.0",
- "source": {
- "type": "git",
- "url": "https://github.com/sebastianbergmann/type.git",
- "reference": "b233b84bc4465aff7b57cf1c4bc75c86d00d6dad"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/b233b84bc4465aff7b57cf1c4bc75c86d00d6dad",
- "reference": "b233b84bc4465aff7b57cf1c4bc75c86d00d6dad",
- "shasum": ""
- },
- "require": {
- "php": ">=7.3"
- },
- "require-dev": {
- "phpunit/phpunit": "^9.5"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "3.0-dev"
- }
- },
- "autoload": {
- "classmap": [
- "src/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "BSD-3-Clause"
- ],
- "authors": [
- {
- "name": "Sebastian Bergmann",
- "email": "sebastian@phpunit.de",
- "role": "lead"
- }
- ],
- "description": "Collection of value objects that represent the types of the PHP type system",
- "homepage": "https://github.com/sebastianbergmann/type",
- "support": {
- "issues": "https://github.com/sebastianbergmann/type/issues",
- "source": "https://github.com/sebastianbergmann/type/tree/3.0.0"
- },
- "funding": [
- {
- "url": "https://github.com/sebastianbergmann",
- "type": "github"
- }
- ],
- "time": "2022-03-15T09:54:48+00:00"
- },
- {
- "name": "sebastian/version",
- "version": "3.0.2",
- "source": {
- "type": "git",
- "url": "https://github.com/sebastianbergmann/version.git",
- "reference": "c6c1022351a901512170118436c764e473f6de8c"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c6c1022351a901512170118436c764e473f6de8c",
- "reference": "c6c1022351a901512170118436c764e473f6de8c",
- "shasum": ""
- },
- "require": {
- "php": ">=7.3"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "3.0-dev"
- }
- },
- "autoload": {
- "classmap": [
- "src/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "BSD-3-Clause"
- ],
- "authors": [
- {
- "name": "Sebastian Bergmann",
- "email": "sebastian@phpunit.de",
- "role": "lead"
- }
- ],
- "description": "Library that helps with managing the version number of Git-hosted PHP projects",
- "homepage": "https://github.com/sebastianbergmann/version",
- "support": {
- "issues": "https://github.com/sebastianbergmann/version/issues",
- "source": "https://github.com/sebastianbergmann/version/tree/3.0.2"
- },
- "funding": [
- {
- "url": "https://github.com/sebastianbergmann",
- "type": "github"
- }
- ],
- "time": "2020-09-28T06:39:44+00:00"
- },
- {
- "name": "squizlabs/php_codesniffer",
- "version": "3.6.2",
- "source": {
- "type": "git",
- "url": "https://github.com/squizlabs/PHP_CodeSniffer.git",
- "reference": "5e4e71592f69da17871dba6e80dd51bce74a351a"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/5e4e71592f69da17871dba6e80dd51bce74a351a",
- "reference": "5e4e71592f69da17871dba6e80dd51bce74a351a",
- "shasum": ""
- },
- "require": {
- "ext-simplexml": "*",
- "ext-tokenizer": "*",
- "ext-xmlwriter": "*",
- "php": ">=5.4.0"
- },
- "require-dev": {
- "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0"
- },
- "bin": [
- "bin/phpcs",
- "bin/phpcbf"
- ],
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "3.x-dev"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "BSD-3-Clause"
- ],
- "authors": [
- {
- "name": "Greg Sherwood",
- "role": "lead"
- }
- ],
- "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.",
- "homepage": "https://github.com/squizlabs/PHP_CodeSniffer",
- "keywords": [
- "phpcs",
- "standards"
- ],
- "support": {
- "issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues",
- "source": "https://github.com/squizlabs/PHP_CodeSniffer",
- "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki"
- },
- "time": "2021-12-12T21:44:58+00:00"
- },
- {
- "name": "symfony/config",
- "version": "v6.0.3",
- "source": {
- "type": "git",
- "url": "https://github.com/symfony/config.git",
- "reference": "c14f32ae4cd2a3c29d8825c5093463ac08ade7d8"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/symfony/config/zipball/c14f32ae4cd2a3c29d8825c5093463ac08ade7d8",
- "reference": "c14f32ae4cd2a3c29d8825c5093463ac08ade7d8",
- "shasum": ""
- },
- "require": {
- "php": ">=8.0.2",
- "symfony/deprecation-contracts": "^2.1|^3",
- "symfony/filesystem": "^5.4|^6.0",
- "symfony/polyfill-ctype": "~1.8",
- "symfony/polyfill-php81": "^1.22"
- },
- "conflict": {
- "symfony/finder": "<4.4"
- },
- "require-dev": {
- "symfony/event-dispatcher": "^5.4|^6.0",
- "symfony/finder": "^5.4|^6.0",
- "symfony/messenger": "^5.4|^6.0",
- "symfony/service-contracts": "^1.1|^2|^3",
- "symfony/yaml": "^5.4|^6.0"
- },
- "suggest": {
- "symfony/yaml": "To use the yaml reference dumper"
- },
- "type": "library",
- "autoload": {
- "psr-4": {
- "Symfony\\Component\\Config\\": ""
- },
- "exclude-from-classmap": [
- "/Tests/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Fabien Potencier",
- "email": "fabien@symfony.com"
- },
- {
- "name": "Symfony Community",
- "homepage": "https://symfony.com/contributors"
- }
- ],
- "description": "Helps you find, load, combine, autofill and validate configuration values of any kind",
- "homepage": "https://symfony.com",
- "support": {
- "source": "https://github.com/symfony/config/tree/v6.0.3"
- },
- "funding": [
- {
- "url": "https://symfony.com/sponsor",
- "type": "custom"
- },
- {
- "url": "https://github.com/fabpot",
- "type": "github"
- },
- {
- "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
- "type": "tidelift"
- }
- ],
- "time": "2022-01-03T09:53:43+00:00"
- },
- {
- "name": "symfony/filesystem",
- "version": "v6.0.6",
- "source": {
- "type": "git",
- "url": "https://github.com/symfony/filesystem.git",
- "reference": "52b888523545b0b4049ab9ce48766802484d7046"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/symfony/filesystem/zipball/52b888523545b0b4049ab9ce48766802484d7046",
- "reference": "52b888523545b0b4049ab9ce48766802484d7046",
- "shasum": ""
- },
- "require": {
- "php": ">=8.0.2",
- "symfony/polyfill-ctype": "~1.8",
- "symfony/polyfill-mbstring": "~1.8"
- },
- "type": "library",
- "autoload": {
- "psr-4": {
- "Symfony\\Component\\Filesystem\\": ""
- },
- "exclude-from-classmap": [
- "/Tests/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Fabien Potencier",
- "email": "fabien@symfony.com"
- },
- {
- "name": "Symfony Community",
- "homepage": "https://symfony.com/contributors"
- }
- ],
- "description": "Provides basic utilities for the filesystem",
- "homepage": "https://symfony.com",
- "support": {
- "source": "https://github.com/symfony/filesystem/tree/v6.0.6"
- },
- "funding": [
- {
- "url": "https://symfony.com/sponsor",
- "type": "custom"
- },
- {
- "url": "https://github.com/fabpot",
- "type": "github"
- },
- {
- "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
- "type": "tidelift"
- }
- ],
- "time": "2022-03-02T12:58:14+00:00"
- },
- {
- "name": "symfony/polyfill-ctype",
- "version": "v1.25.0",
- "source": {
- "type": "git",
- "url": "https://github.com/symfony/polyfill-ctype.git",
- "reference": "30885182c981ab175d4d034db0f6f469898070ab"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/30885182c981ab175d4d034db0f6f469898070ab",
- "reference": "30885182c981ab175d4d034db0f6f469898070ab",
- "shasum": ""
- },
- "require": {
- "php": ">=7.1"
- },
- "provide": {
- "ext-ctype": "*"
- },
- "suggest": {
- "ext-ctype": "For best performance"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-main": "1.23-dev"
- },
- "thanks": {
- "name": "symfony/polyfill",
- "url": "https://github.com/symfony/polyfill"
- }
- },
- "autoload": {
- "files": [
- "bootstrap.php"
- ],
- "psr-4": {
- "Symfony\\Polyfill\\Ctype\\": ""
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Gert de Pagter",
- "email": "BackEndTea@gmail.com"
- },
- {
- "name": "Symfony Community",
- "homepage": "https://symfony.com/contributors"
- }
- ],
- "description": "Symfony polyfill for ctype functions",
- "homepage": "https://symfony.com",
- "keywords": [
- "compatibility",
- "ctype",
- "polyfill",
- "portable"
- ],
- "support": {
- "source": "https://github.com/symfony/polyfill-ctype/tree/v1.25.0"
- },
- "funding": [
- {
- "url": "https://symfony.com/sponsor",
- "type": "custom"
- },
- {
- "url": "https://github.com/fabpot",
- "type": "github"
- },
- {
- "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
- "type": "tidelift"
- }
- ],
- "time": "2021-10-20T20:35:02+00:00"
- },
- {
- "name": "symfony/polyfill-php81",
- "version": "v1.25.0",
- "source": {
- "type": "git",
- "url": "https://github.com/symfony/polyfill-php81.git",
- "reference": "5de4ba2d41b15f9bd0e19b2ab9674135813ec98f"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/5de4ba2d41b15f9bd0e19b2ab9674135813ec98f",
- "reference": "5de4ba2d41b15f9bd0e19b2ab9674135813ec98f",
- "shasum": ""
- },
- "require": {
- "php": ">=7.1"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-main": "1.23-dev"
- },
- "thanks": {
- "name": "symfony/polyfill",
- "url": "https://github.com/symfony/polyfill"
- }
- },
- "autoload": {
- "files": [
- "bootstrap.php"
- ],
- "psr-4": {
- "Symfony\\Polyfill\\Php81\\": ""
- },
- "classmap": [
- "Resources/stubs"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Nicolas Grekas",
- "email": "p@tchwork.com"
- },
- {
- "name": "Symfony Community",
- "homepage": "https://symfony.com/contributors"
- }
- ],
- "description": "Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions",
- "homepage": "https://symfony.com",
- "keywords": [
- "compatibility",
- "polyfill",
- "portable",
- "shim"
- ],
- "support": {
- "source": "https://github.com/symfony/polyfill-php81/tree/v1.25.0"
- },
- "funding": [
- {
- "url": "https://symfony.com/sponsor",
- "type": "custom"
- },
- {
- "url": "https://github.com/fabpot",
- "type": "github"
- },
- {
- "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
- "type": "tidelift"
- }
- ],
- "time": "2021-09-13T13:58:11+00:00"
- },
- {
- "name": "symfony/stopwatch",
- "version": "v6.0.5",
- "source": {
- "type": "git",
- "url": "https://github.com/symfony/stopwatch.git",
- "reference": "f2c1780607ec6502f2121d9729fd8150a655d337"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/symfony/stopwatch/zipball/f2c1780607ec6502f2121d9729fd8150a655d337",
- "reference": "f2c1780607ec6502f2121d9729fd8150a655d337",
- "shasum": ""
- },
- "require": {
- "php": ">=8.0.2",
- "symfony/service-contracts": "^1|^2|^3"
- },
- "type": "library",
- "autoload": {
- "psr-4": {
- "Symfony\\Component\\Stopwatch\\": ""
- },
- "exclude-from-classmap": [
- "/Tests/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Fabien Potencier",
- "email": "fabien@symfony.com"
- },
- {
- "name": "Symfony Community",
- "homepage": "https://symfony.com/contributors"
- }
- ],
- "description": "Provides a way to profile code",
- "homepage": "https://symfony.com",
- "support": {
- "source": "https://github.com/symfony/stopwatch/tree/v6.0.5"
- },
- "funding": [
- {
- "url": "https://symfony.com/sponsor",
- "type": "custom"
- },
- {
- "url": "https://github.com/fabpot",
- "type": "github"
- },
- {
- "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
- "type": "tidelift"
- }
- ],
- "time": "2022-02-21T17:15:17+00:00"
- },
- {
- "name": "symfony/yaml",
- "version": "v5.3.14",
- "source": {
- "type": "git",
- "url": "https://github.com/symfony/yaml.git",
- "reference": "c441e9d2e340642ac8b951b753dea962d55b669d"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/symfony/yaml/zipball/c441e9d2e340642ac8b951b753dea962d55b669d",
- "reference": "c441e9d2e340642ac8b951b753dea962d55b669d",
- "shasum": ""
- },
- "require": {
- "php": ">=7.2.5",
- "symfony/deprecation-contracts": "^2.1",
- "symfony/polyfill-ctype": "~1.8"
- },
- "conflict": {
- "symfony/console": "<4.4"
- },
- "require-dev": {
- "symfony/console": "^4.4|^5.0"
- },
- "suggest": {
- "symfony/console": "For validating YAML files using the lint command"
- },
- "bin": [
- "Resources/bin/yaml-lint"
- ],
- "type": "library",
- "autoload": {
- "psr-4": {
- "Symfony\\Component\\Yaml\\": ""
- },
- "exclude-from-classmap": [
- "/Tests/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Fabien Potencier",
- "email": "fabien@symfony.com"
- },
- {
- "name": "Symfony Community",
- "homepage": "https://symfony.com/contributors"
- }
- ],
- "description": "Loads and dumps YAML files",
- "homepage": "https://symfony.com",
- "support": {
- "source": "https://github.com/symfony/yaml/tree/v5.3.14"
- },
- "funding": [
- {
- "url": "https://symfony.com/sponsor",
- "type": "custom"
- },
- {
- "url": "https://github.com/fabpot",
- "type": "github"
- },
- {
- "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
- "type": "tidelift"
- }
- ],
- "time": "2022-01-26T16:05:39+00:00"
- },
- {
- "name": "thecodingmachine/phpstan-strict-rules",
- "version": "v1.0.0",
- "source": {
- "type": "git",
- "url": "https://github.com/thecodingmachine/phpstan-strict-rules.git",
- "reference": "2ba8fa8b328c45f3b149c05def5bf96793c594b6"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/thecodingmachine/phpstan-strict-rules/zipball/2ba8fa8b328c45f3b149c05def5bf96793c594b6",
- "reference": "2ba8fa8b328c45f3b149c05def5bf96793c594b6",
- "shasum": ""
- },
- "require": {
- "php": "^7.1|^8.0",
- "phpstan/phpstan": "^1.0"
- },
- "require-dev": {
- "php-coveralls/php-coveralls": "^2.1",
- "phpunit/phpunit": "^7.1"
- },
- "type": "phpstan-extension",
- "extra": {
- "branch-alias": {
- "dev-master": "1.0-dev"
- },
- "phpstan": {
- "includes": [
- "phpstan-strict-rules.neon"
- ]
- }
- },
- "autoload": {
- "psr-4": {
- "TheCodingMachine\\PHPStan\\": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "David Négrier",
- "email": "d.negrier@thecodingmachine.com"
- }
- ],
- "description": "A set of additional rules for PHPStan based on best practices followed at TheCodingMachine",
- "support": {
- "issues": "https://github.com/thecodingmachine/phpstan-strict-rules/issues",
- "source": "https://github.com/thecodingmachine/phpstan-strict-rules/tree/v1.0.0"
- },
- "time": "2021-11-08T09:10:49+00:00"
- },
- {
- "name": "theseer/tokenizer",
- "version": "1.2.1",
- "source": {
- "type": "git",
- "url": "https://github.com/theseer/tokenizer.git",
- "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/theseer/tokenizer/zipball/34a41e998c2183e22995f158c581e7b5e755ab9e",
- "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e",
- "shasum": ""
- },
- "require": {
- "ext-dom": "*",
- "ext-tokenizer": "*",
- "ext-xmlwriter": "*",
- "php": "^7.2 || ^8.0"
- },
- "type": "library",
- "autoload": {
- "classmap": [
- "src/"
- ]
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "BSD-3-Clause"
- ],
- "authors": [
- {
- "name": "Arne Blankerts",
- "email": "arne@blankerts.de",
- "role": "Developer"
- }
- ],
- "description": "A small library for converting tokenized PHP source code into XML and potentially other formats",
- "support": {
- "issues": "https://github.com/theseer/tokenizer/issues",
- "source": "https://github.com/theseer/tokenizer/tree/1.2.1"
- },
- "funding": [
- {
- "url": "https://github.com/theseer",
- "type": "github"
- }
- ],
- "time": "2021-07-28T10:34:58+00:00"
- },
- {
- "name": "webmozart/assert",
- "version": "1.10.0",
- "source": {
- "type": "git",
- "url": "https://github.com/webmozarts/assert.git",
- "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/webmozarts/assert/zipball/6964c76c7804814a842473e0c8fd15bab0f18e25",
- "reference": "6964c76c7804814a842473e0c8fd15bab0f18e25",
- "shasum": ""
- },
- "require": {
- "php": "^7.2 || ^8.0",
- "symfony/polyfill-ctype": "^1.8"
- },
- "conflict": {
- "phpstan/phpstan": "<0.12.20",
- "vimeo/psalm": "<4.6.1 || 4.6.2"
- },
- "require-dev": {
- "phpunit/phpunit": "^8.5.13"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "1.10-dev"
- }
- },
- "autoload": {
- "psr-4": {
- "Webmozart\\Assert\\": "src/"
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Bernhard Schussek",
- "email": "bschussek@gmail.com"
- }
- ],
- "description": "Assertions to validate method input/output with nice error messages.",
- "keywords": [
- "assert",
- "check",
- "validate"
- ],
- "support": {
- "issues": "https://github.com/webmozarts/assert/issues",
- "source": "https://github.com/webmozarts/assert/tree/1.10.0"
- },
- "time": "2021-03-09T10:59:23+00:00"
- }
- ],
- "aliases": [],
- "minimum-stability": "stable",
- "stability-flags": [],
- "prefer-stable": false,
- "prefer-lowest": false,
- "platform": {
- "php": "^8.0",
- "ext-simplexml": "*",
- "ext-json": "*"
- },
- "platform-dev": [],
- "plugin-api-version": "2.3.0"
-}
diff --git a/generator/config/ignoredFunctions.php b/generator/config/ignoredFunctions.php
index 6e0554e9..a820eb2b 100644
--- a/generator/config/ignoredFunctions.php
+++ b/generator/config/ignoredFunctions.php
@@ -16,4 +16,6 @@
'apcu_delete', // apcu_delete returns false when the $key does not exist in the cache store
'filter_has_var', // this function is meant to return a boolean
'array_multisort', // this function is too buggy, see PR #113 on GitHub
+ 'dba_open', // int default value used for string parameter
+ 'dba_popen', // int default value used for string parameter
];
diff --git a/generator/phpcs.xml.dist b/generator/phpcs.xml.dist
index 480486b4..b49ec5d7 100644
--- a/generator/phpcs.xml.dist
+++ b/generator/phpcs.xml.dist
@@ -7,7 +7,7 @@
-
+
src
diff --git a/generator/phpstan.neon b/generator/phpstan.neon
index bf8cad2d..0dcbf845 100644
--- a/generator/phpstan.neon
+++ b/generator/phpstan.neon
@@ -1,4 +1,8 @@
parameters:
+ paths:
+ - ./src
+ # The level 9 is the highest level (with check for mixed type)
+ level: 8
ignoreErrors:
includes:
- - vendor/thecodingmachine/phpstan-strict-rules/phpstan-strict-rules.neon
\ No newline at end of file
+ - vendor/thecodingmachine/phpstan-strict-rules/phpstan-strict-rules.neon
diff --git a/generator/phpunit.xml.dist b/generator/phpunit.xml.dist
index b04faf99..323f273a 100644
--- a/generator/phpunit.xml.dist
+++ b/generator/phpunit.xml.dist
@@ -1,24 +1,30 @@
-
-
-
- src
-
-
-
-
-
-
-
-
- ./tests/
- ./tests/rector
-
-
+
+
+
+
+
+
+
+
+ ./tests/
+ ./tests/rector
+
+
+
+
+ src
+
+
diff --git a/generator/rector.php b/generator/rector.php
new file mode 100644
index 00000000..64176b31
--- /dev/null
+++ b/generator/rector.php
@@ -0,0 +1,47 @@
+withPaths([
+ __DIR__.'/src',
+ ])
+ // uncomment to reach your current PHP version
+ ->withPhpSets()
+ ->withRules([
+ AddVoidReturnTypeWhereNoReturnRector::class,
+ ChangeConstantVisibilityRector::class,
+ RenameForeachValueVariableToMatchExprVariableRector::class,
+ ReturnTypeFromReturnNewRector::class,
+ CountArrayToEmptyArrayComparisonRector::class,
+ StrictArraySearchRector::class,
+ SymplifyQuoteEscapeRector::class,
+ DeclareStrictTypesRector::class,
+ ])
+ ->withSets([
+ PHPUnitSetList::PHPUNIT_110,
+ ])
+ ->withPhpSets()
+ ->withPHPStanConfigs(['phpstan.neon'])
+ ->withPreparedSets(
+ deadCode: true,
+ codeQuality: true,
+ codingStyle: true,
+ typeDeclarations: true,
+ privatization: true,
+ naming: true,
+ instanceOf: true,
+ earlyReturn: true,
+ strictBooleans: true
+ );
diff --git a/generator/src/ComposerJsonEditor.php b/generator/src/ComposerJsonEditor.php
index 8e3b76a5..d02915ec 100644
--- a/generator/src/ComposerJsonEditor.php
+++ b/generator/src/ComposerJsonEditor.php
@@ -1,5 +1,6 @@
> $composerJson */
$composerJson = \json_decode($composerContent, true);
$composerJson['autoload']['files'] = self::editFileListForDeprecation($composerJson['autoload']['files'], $moduleName);
@@ -30,11 +32,12 @@ public static function editComposerFileForDeprecation(string $moduleName): void
*/
public static function editComposerFileForGeneration(array $modules): void
{
-
+
$composerContent = file_get_contents(self::COMPOSER_FILEPATH);
if ($composerContent === false) {
throw new \RuntimeException('Error while loading composer.json file for edition.');
}
+
/** @var array> $composerJson */
$composerJson = \json_decode($composerContent, true);
$composerJson['autoload']['files'] = self::editFilesListForGeneration($composerJson['autoload']['files'], $modules);
@@ -42,10 +45,7 @@ public static function editComposerFileForGeneration(array $modules): void
$newContent = \json_encode($composerJson, \JSON_PRETTY_PRINT | \JSON_UNESCAPED_SLASHES);
\file_put_contents(self::COMPOSER_FILEPATH, $newContent);
}
-
-
-
-
+
/**
* @param string[] $oldFiles
* @param string[] $modules A list of modules
@@ -53,12 +53,11 @@ public static function editComposerFileForGeneration(array $modules): void
*/
public static function editFilesListForGeneration(array $oldFiles, array $modules): array
{
- $files = array_values(array_filter($oldFiles, function ($file) {
- return strpos($file, 'generated/') === false;
- }));
+ $files = array_values(array_filter($oldFiles, fn($file): bool => !str_contains($file, 'generated/')));
foreach ($modules as $module) {
- $files[] = 'generated/'.lcfirst($module).'.php';
+ $files[] = 'generated/' . lcfirst($module) . '.php';
}
+
return $files;
}
@@ -70,11 +69,7 @@ public static function editFileListForDeprecation(array $fileList, string $modul
{
$newList = [];
foreach ($fileList as $fileName) {
- if ($fileName === "generated/$moduleName.php") {
- $newList[] = "deprecated/$moduleName.php";
- } else {
- $newList[] = $fileName;
- }
+ $newList[] = $fileName === sprintf('generated/%s.php', $moduleName) ? sprintf('deprecated/%s.php', $moduleName) : $fileName;
}
return $newList;
diff --git a/generator/src/DeprecateCommand.php b/generator/src/DeprecateCommand.php
index 3f4dd56d..6782d55c 100644
--- a/generator/src/DeprecateCommand.php
+++ b/generator/src/DeprecateCommand.php
@@ -1,5 +1,6 @@
getArgument('module');
-
- $moduleFilePath = self::GENERATE_DIRECTORY."$moduleName.php";
+
+ $moduleFilePath = self::GENERATE_DIRECTORY . ($moduleName . '.php');
if (!\file_exists($moduleFilePath)) {
- throw new \RuntimeException("Module $moduleName is not maintained!");
+ throw new \RuntimeException(sprintf('Module %s is not maintained!', $moduleName));
}
- $output->writeln("Move $moduleName.php to deprecated");
- $success = \rename($moduleFilePath, self::DEPRECATE_DIRECTORY."$moduleName.php");
+ $output->writeln(sprintf('Move %s.php to deprecated', $moduleName));
+ $success = \rename($moduleFilePath, self::DEPRECATE_DIRECTORY . ($moduleName . '.php'));
if (!$success) {
throw new \RuntimeException("Could not move the file.");
}
- $exceptionFilePath = self::GENERATE_DIRECTORY.self::getExceptionFilePath($moduleName);
+ $exceptionFilePath = self::GENERATE_DIRECTORY . self::getExceptionFilePath($moduleName);
if (\file_exists($exceptionFilePath)) {
$output->writeln("Move exception file to deprecated");
- $success = \rename($exceptionFilePath, self::DEPRECATE_DIRECTORY.self::getExceptionFilePath($moduleName));
+ $success = \rename($exceptionFilePath, self::DEPRECATE_DIRECTORY . self::getExceptionFilePath($moduleName));
if (!$success) {
throw new \RuntimeException("Could not move the file.");
}
@@ -51,15 +53,15 @@ protected function execute(InputInterface $input, OutputInterface $output)
$output->writeln('Editing composer.json');
ComposerJsonEditor::editComposerFileForDeprecation($moduleName);
- $generatedListFile = self::GENERATE_DIRECTORY.'functionsList.php';
- $deprecatedListFile = self::DEPRECATE_DIRECTORY.'functionsList.php';
- $output->writeln("Don't forget to edit $generatedListFile and $deprecatedListFile !");
-
+ $generatedListFile = self::GENERATE_DIRECTORY . 'functionsList.php';
+ $deprecatedListFile = self::DEPRECATE_DIRECTORY . 'functionsList.php';
+ $output->writeln(sprintf("Don't forget to edit %s and %s !", $generatedListFile, $deprecatedListFile));
+
return 0;
}
-
+
public static function getExceptionFilePath(string $moduleName): string
{
- return "Exceptions/".ucfirst($moduleName)."Exception.php";
+ return "Exceptions/" . ucfirst($moduleName) . "Exception.php";
}
}
diff --git a/generator/src/DocPage.php b/generator/src/DocPage.php
index d55204e5..407fc626 100644
--- a/generator/src/DocPage.php
+++ b/generator/src/DocPage.php
@@ -1,5 +1,7 @@
path = $_path;
}
- // Ignore function if it was removed before PHP 7.1
+ // Ignore function if it was removed before PHP 8.2
private function getIsDeprecated(string $file): bool
{
if (preg_match('/&warn\.deprecated\.function-(\d+-\d+-\d+)\.removed-(\d+-\d+-\d+)/', $file, $matches)) {
$removedVersion = $matches[2];
[$major, $minor] = explode('-', $removedVersion);
- if ($major < 7 || ($major == 7 && $minor == 0)) {
+ if ($major < 8 || ($major == 8 && $minor < 2)) {
return true;
}
}
- if (preg_match('/&warn\.removed\.function-(\d+-\d+-\d+)/', $file, $matches) && isset($matches[2])) {
- $removedVersion = $matches[2];
+ if (preg_match('/&warn\.removed\.function-(\d+-\d+-\d+)/', $file, $matches)) {
+ $removedVersion = $matches[1];
[$major, $minor] = explode('-', $removedVersion);
- if ($major < 7 || ($major == 7 && $minor == 0)) {
+ if ($major < 8 || ($major == 8 && $minor < 2)) {
return true;
}
}
@@ -50,7 +46,7 @@ public function detectFalsyFunction(): bool
{
$file = file_get_contents($this->path);
if ($file === false) {
- throw new \RuntimeException('An error occurred while reading '.$this->path);
+ throw new \RuntimeException('An error occurred while reading ' . $this->path);
}
if ($this->getIsDeprecated($file)) {
@@ -69,48 +65,63 @@ public function detectFalsyFunction(): bool
if (preg_match('/&false;\s+on\s+error/m', $returnValuesSection)) {
return true;
}
+
if (preg_match('/&false;\s+on\s+failure/m', $returnValuesSection)) {
return true;
}
- if (preg_match('/&false;\s+otherwise/m', $returnValuesSection) && !preg_match('/(returns\s+&true;|&true;\s+on\s+success|&true;\s+if)/im', $returnValuesSection)) {
+
+ if (preg_match('/&false;\s+otherwise/m', $returnValuesSection) && (preg_match('/(returns\s+&true;|&true;\s+on\s+success|&true;\s+if)/im', $returnValuesSection) === 0 || preg_match('/(returns\s+&true;|&true;\s+on\s+success|&true;\s+if)/im', $returnValuesSection) === false)) {
return true;
}
- if (preg_match('/may\s+return\s+&false;/m', $returnValuesSection) && !preg_match('/(returns\s+&true;|&true;\s+on\s+success|&true;\s+if)/im', $returnValuesSection)) {
+
+ if (preg_match('/may\s+return\s+&false;/m', $returnValuesSection) && (preg_match('/(returns\s+&true;|&true;\s+on\s+success|&true;\s+if)/im', $returnValuesSection) === 0 || preg_match('/(returns\s+&true;|&true;\s+on\s+success|&true;\s+if)/im', $returnValuesSection) === false)) {
return true;
}
+
if (preg_match('/&false;\s+if\s+an\s+error\s+occurred/m', $returnValuesSection)) {
return true;
}
+
if (preg_match('/&return.success;/m', $returnValuesSection)) {
return true;
}
+
if (preg_match('/&return.nullorfalse;/m', $returnValuesSection)) {
return true;
}
+
if (preg_match('/&return.falseforfailure;/m', $returnValuesSection)) {
return true;
}
+
if (preg_match('/&date.datetime.return.modifiedobjectorfalseforfailure;/m', $returnValuesSection)) {
return true;
}
+
if (preg_match('/ or &false; \\(and generates an error/m', $returnValuesSection)) {
return true;
}
+
if (preg_match('/&false;\s+if\s+the\s+number\s+of\s+elements\s+for\s+each\s+array\s+isn\'t\s+equal/m', $returnValuesSection)) {
return true;
}
+
if (preg_match('/If\s+the\s+call\s+fails,\s+it\s+will\s+return\s+&false;/m', $returnValuesSection)) {
return true;
}
+
if (preg_match('/Upon\s+failure,?\s+\[\w_]{1,15}?\<\/function\>\s+returns\s+&false;/m', $returnValuesSection)) {
return true;
}
+
if (preg_match('/On\s+failure,\s+&false;\s+is\s+returned/m', $returnValuesSection)) {
return true;
}
+
if (preg_match('/on\s+success,\s+otherwise\s+&false;\s+is\s+returned/m', $returnValuesSection)) {
return true;
}
+
if (preg_match('/Returns.*on success[.\s\S]+Returns &false;\s+if/m', $returnValuesSection)) {
return true;
}
@@ -118,9 +129,12 @@ public function detectFalsyFunction(): bool
if (preg_match('/&gd\.return\.identifier;/m', $returnValuesSection)) {
return true;
}
+
//used for date
- if (preg_match('/If a non-numeric value is used for
- \timestamp\<\/parameter\>, &false; is returned/m', $returnValuesSection)) {
+ if (
+ preg_match('/If a non-numeric value is used for
+ \timestamp\<\/parameter\>, &false; is returned/m', $returnValuesSection)
+ ) {
return true;
}
@@ -135,11 +149,7 @@ public function detectFalsyFunction(): bool
}
//used to detect get_headers and ldap_search
- if (preg_match("/&false; on failure/m", $returnValuesSection)) {
- return true;
- }
-
- return false;
+ return (bool) preg_match("/&false; on failure/m", $returnValuesSection);
}
/*
@@ -149,7 +159,7 @@ public function detectNullsyFunction(): bool
{
$file = \file_get_contents($this->path);
if ($file === false) {
- throw new \RuntimeException('An error occurred while reading '.$this->path);
+ throw new \RuntimeException('An error occurred while reading ' . $this->path);
}
if ($this->getIsDeprecated($file)) {
@@ -164,11 +174,8 @@ public function detectNullsyFunction(): bool
if (preg_match('/&null;\s+on\s+failure/', $returnValuesSection)) {
return true;
}
- if (preg_match('/&null;\s+if\s+an\s+error\s+occurs/', $returnValuesSection)) {
- return true;
- }
- return false;
+ return (bool) preg_match('/&null;\s+if\s+an\s+error\s+occurs/', $returnValuesSection);
}
/*
@@ -178,19 +185,15 @@ public function detectEmptyFunction(): bool
{
$file = file_get_contents($this->path);
if ($file === false) {
- throw new \RuntimeException('An error occurred while reading '.$this->path);
+ throw new \RuntimeException('An error occurred while reading ' . $this->path);
}
+
if ($this->getIsDeprecated($file)) {
return false;
}
$returnValuesSection = $this->extractSection('returnvalues', $file);
-
- if (preg_match('/an\s+empty\s+string\s+on\s+error/', $returnValuesSection)) {
- return true;
- }
-
- return false;
+ return (bool) preg_match('/an\s+empty\s+string\s+on\s+error/', $returnValuesSection);
}
/**
@@ -203,7 +206,7 @@ public function getMethodSynopsis(): array
$file = \file_get_contents($this->path);
if ($file === false) {
- throw new \RuntimeException('An error occurred while reading '.$this->path);
+ throw new \RuntimeException('An error occurred while reading ' . $this->path);
}
// Only evaluate the synopsis inside the `...` section of the doc page.
@@ -211,7 +214,7 @@ public function getMethodSynopsis(): array
// handlers, callbacks, and other callable-type arguments, not the function itself.
$fileDescriptionSection = $this->extractSection('description', $file);
- if (!preg_match_all('/<\/?methodsynopsis[\s\S]*?>[\s\S]*?<\/methodsynopsis>/m', $fileDescriptionSection, $functions, PREG_SET_ORDER, 0)) {
+ if (preg_match_all('/<\/?methodsynopsis[\s\S]*?>[\s\S]*?<\/methodsynopsis>/m', $fileDescriptionSection, $functions, PREG_SET_ORDER, 0) === 0 || preg_match_all('/<\/?methodsynopsis[\s\S]*?>[\s\S]*?<\/methodsynopsis>/m', $fileDescriptionSection, $functions, PREG_SET_ORDER, 0) === false) {
return [];
}
@@ -222,8 +225,10 @@ public function getMethodSynopsis(): array
if (!\is_string($cleaningFunction)) {
throw new \RuntimeException('Error occurred in preg_replace');
}
+
$cleanedFunctions[] = $cleaningFunction;
}
+
$functionObjects = [];
foreach ($cleanedFunctions as $cleanedFunction) {
$functionObject = \simplexml_load_string($cleanedFunction);
@@ -231,36 +236,38 @@ public function getMethodSynopsis(): array
$functionObjects[] = $functionObject;
}
}
+
return $functionObjects;
}
/**
* Loads the XML file, resolving all DTD declared entities.
- *
- * @return \SimpleXMLElement
*/
public function loadAndResolveFile(): \SimpleXMLElement
{
$content = \file_get_contents($this->path);
if ($content === false) {
- throw new \RuntimeException('An error occurred while reading '.$this->path);
+ throw new \RuntimeException('An error occurred while reading ' . $this->path);
}
- $strpos = \strpos($content, '?>')+2;
- if (!\file_exists(__DIR__.'/../doc/entities/generated.ent')) {
+
+ $strpos = \strpos($content, '?>') + 2;
+ if (!\file_exists(__DIR__ . '/../doc/entities/generated.ent')) {
self::buildEntities();
}
- $path = \realpath(__DIR__.'/../doc/entities/generated.ent');
+
+ $path = \realpath(__DIR__ . '/../doc/entities/generated.ent');
$content = \substr($content, 0, $strpos)
- .''
- .\substr($content, $strpos+1);
+ . ''
+ . \substr($content, $strpos + 1);
- echo 'Loading '.$this->path."\n";
+ echo 'Loading ' . $this->path . "\n";
$elem = \simplexml_load_string($content, \SimpleXMLElement::class, LIBXML_DTDLOAD | LIBXML_NOENT);
if ($elem === false) {
- throw new \RuntimeException('Invalid XML file for '.$this->path);
+ throw new \RuntimeException('Invalid XML file for ' . $this->path);
}
+
$elem->registerXPathNamespace('docbook', 'http://docbook.org/ns/docbook');
return $elem;
@@ -268,8 +275,6 @@ public function loadAndResolveFile(): \SimpleXMLElement
/**
* Returns the module name in Camelcase.
- *
- * @return string
*/
public function getModule(): string
{
@@ -281,8 +286,7 @@ private function extractSection(string $sectionName, string $file): string
$regexpBase = '/[\s\S]*?<\/refsect1>/m';
$regexpString = sprintf($regexpBase, preg_quote($sectionName, '/'));
preg_match_all($regexpString, $file, $output);
- $output = implode('', $this->arrayFlatten((array) $output));
- return $output;
+ return implode('', $this->arrayFlatten((array) $output));
}
private function toCamelCase(string $str): string
@@ -315,24 +319,25 @@ private function arrayFlatten(array $array): array
$result[$key] = strval($value);
}
}
+
return $result;
}
public static function buildEntities(): void
{
- $file1 = \file_get_contents(__DIR__.'/../doc/doc-en/en/language-defs.ent') ?: '';
- $file2 = \file_get_contents(__DIR__.'/../doc/doc-en/en/language-snippets.ent') ?: '';
- $file3 = \file_get_contents(__DIR__.'/../doc/doc-en/en/extensions.ent') ?: '';
- $file4 = \file_get_contents(__DIR__.'/../doc/doc-en/doc-base/entities/global.ent') ?: '';
+ $file1 = \file_get_contents(__DIR__ . '/../doc/doc-en/en/language-defs.ent') ?: '';
+ $file2 = \file_get_contents(__DIR__ . '/../doc/doc-en/en/language-snippets.ent') ?: '';
+ $file3 = \file_get_contents(__DIR__ . '/../doc/doc-en/en/extensions.ent') ?: '';
+ $file4 = \file_get_contents(__DIR__ . '/../doc/doc-en/doc-base/entities/global.ent') ?: '';
$completeFile = $file1 . self::extractXmlHeader($file2) . self::extractXmlHeader($file3) . $file4;
- \file_put_contents(__DIR__.'/../doc/entities/generated.ent', $completeFile);
+ \file_put_contents(__DIR__ . '/../doc/entities/generated.ent', $completeFile);
}
private static function extractXmlHeader(string $content): string
{
- $strpos = strpos($content, '?>')+2;
+ $strpos = strpos($content, '?>') + 2;
return substr($content, $strpos);
}
}
diff --git a/generator/src/EmptyTypeException.php b/generator/src/EmptyTypeException.php
index cf584eca..2ad02b3c 100644
--- a/generator/src/EmptyTypeException.php
+++ b/generator/src/EmptyTypeException.php
@@ -1,5 +1,6 @@
$phpFunctions) {
$lcModule = \lcfirst($module);
- $stream = \fopen($path.$lcModule.'.php', 'w');
+ $stream = \fopen($path . $lcModule . '.php', 'w');
if ($stream === false) {
- throw new \RuntimeException('Unable to write to '.$path);
+ throw new \RuntimeException('Unable to write to ' . $path);
}
+
\fwrite($stream, "getFunctionName();
- }, $functions);
- $specialCases = require __DIR__.'/../config/specialCasesFunctions.php';
+ $functionNames = array_map(fn(Method $method): string => $method->getFunctionName(), $functions);
+ $specialCases = require __DIR__ . '/../config/specialCasesFunctions.php';
$functionNames = array_merge($functionNames, $specialCases);
natcasesort($functionNames);
- $excludeCases = require __DIR__.'/../config/ignoredFunctions.php';
+ $excludeCases = require __DIR__ . '/../config/ignoredFunctions.php';
return array_diff($functionNames, $excludeCases);
}
@@ -64,20 +65,21 @@ private function getFunctionsNameList(array $functions): array
* This function generate a PHP file containing the list of functions we can handle.
*
* @param Method[] $functions
- * @param string $path
*/
public function generateFunctionsList(array $functions, string $path): void
{
$functionNames = $this->getFunctionsNameList($functions);
$stream = fopen($path, 'w');
if ($stream === false) {
- throw new \RuntimeException('Unable to write to '.$path);
+ throw new \RuntimeException('Unable to write to ' . $path);
}
+
fwrite($stream, " 'Safe\\$functionName',\n");
+ fwrite($stream, " '{$functionName}' => 'Safe\\{$functionName}',\n");
}
fwrite($stream, " ]);\n};\n");
@@ -125,9 +126,9 @@ public function generateRectorFile(array $functions, string $path): void
public function createExceptionFile(string $moduleName): void
{
$exceptionName = self::toExceptionName($moduleName);
- if (!file_exists(__DIR__.'/../../lib/Exceptions/'.$exceptionName.'.php')) {
+ if (!file_exists(__DIR__ . '/../../lib/Exceptions/' . $exceptionName . '.php')) {
\file_put_contents(
- __DIR__.'/../../generated/Exceptions/'.$exceptionName.'.php',
+ __DIR__ . '/../../generated/Exceptions/' . $exceptionName . '.php',
<<rmGenerated();
// Let's build the DTD necessary to load the XML files.
DocPage::buildEntities();
- $scanner = new Scanner(__DIR__ . '/../doc/doc-en/en/reference/');
+ $scanner = new Scanner(dirname(__DIR__) . '/doc/doc-en/en/reference/');
$paths = $scanner->getFunctionsPaths();
- $res = $scanner->getMethods($paths);
- $functions = $res->methods;
- $overloadedFunctions = $res->overloadedFunctions;
+ $scannerResponse = $scanner->getMethods($paths);
+ $functions = $scannerResponse->methods;
+ $overloadedFunctions = $scannerResponse->overloadedFunctions;
- $output->writeln('These functions have been ignored and must be dealt with manually: '.\implode(', ', $overloadedFunctions));
+ $output->writeln('These functions have been ignored and must be dealt with manually: ' . \implode(', ', $overloadedFunctions));
$fileCreator = new FileCreator();
- $fileCreator->generatePhpFile($functions, __DIR__ . '/../../generated/');
- $fileCreator->generateFunctionsList($functions, __DIR__ . '/../../generated/functionsList.php');
- $fileCreator->generateRectorFile($functions, __DIR__ . '/../../rector-migrate.php');
+ $fileCreator->generatePhpFile($functions, dirname(__DIR__, 2) . '/generated/');
+ $fileCreator->generateFunctionsList($functions, dirname(__DIR__, 2) . '/generated/functionsList.php');
+ $fileCreator->generateRectorFile($functions, dirname(__DIR__, 2) . '/rector-migrate.php');
$modules = [];
@@ -46,14 +47,14 @@ protected function execute(InputInterface $input, OutputInterface $output)
$modules[$moduleName] = $moduleName;
}
- foreach ($modules as $moduleName => $foo) {
+ foreach (array_keys($modules) as $moduleName) {
$fileCreator->createExceptionFile((string) $moduleName);
}
$this->runCsFix($output);
// Let's require the generated file to check there is no error.
- $files = \glob(__DIR__.'/../../generated/*.php');
+ $files = \glob(dirname(__DIR__, 2) . '/generated/*.php');
if ($files === false) {
throw new \RuntimeException('Failed to require the generated file');
}
@@ -62,12 +63,12 @@ protected function execute(InputInterface $input, OutputInterface $output)
require($file);
}
- $files = \glob(__DIR__.'/../../generated/Exceptions/*.php');
+ $files = \glob(dirname(__DIR__, 2) . '/generated/Exceptions/*.php');
if ($files === false) {
throw new \RuntimeException('Failed to require the generated exception file');
}
- require_once __DIR__.'/../../lib/Exceptions/SafeExceptionInterface.php';
+ require_once dirname(__DIR__, 2) . '/lib/Exceptions/SafeExceptionInterface.php';
foreach ($files as $file) {
require($file);
}
@@ -81,7 +82,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
private function rmGenerated(): void
{
- $exceptions = \glob(__DIR__.'/../../generated/Exceptions/*.php');
+ $exceptions = \glob(dirname(__DIR__, 2) . '/generated/Exceptions/*.php');
if ($exceptions === false) {
throw new \RuntimeException('Failed to require the generated exception files');
}
@@ -90,7 +91,7 @@ private function rmGenerated(): void
\unlink($exception);
}
- $files = \glob(__DIR__.'/../../generated/*.php');
+ $files = \glob(dirname(__DIR__, 2) . '/generated/*.php');
if ($files === false) {
throw new \RuntimeException('Failed to require the generated files');
}
@@ -99,20 +100,20 @@ private function rmGenerated(): void
\unlink($file);
}
- if (\file_exists(__DIR__.'/../doc/entities/generated.ent')) {
- \unlink(__DIR__.'/../doc/entities/generated.ent');
+ if (\file_exists(dirname(__DIR__, 2) . '/doc/entities/generated.ent')) {
+ \unlink(dirname(__DIR__, 2) . '/doc/entities/generated.ent');
}
}
private function runCsFix(OutputInterface $output): void
{
- $process = new Process(['vendor/bin/phpcbf'], __DIR__.'/../..');
+ $process = new Process(['vendor/bin/phpcbf'], dirname(__DIR__, 2) . '/');
$process->setTimeout(600);
- $process->run(function ($type, $buffer) use ($output) {
+ $process->run(function ($type, string $buffer) use ($output): void {
if (Process::ERR === $type) {
- echo $output->write(''.$buffer.'');
+ $output->write('' . $buffer . '');
} else {
- echo $output->write($buffer);
+ $output->write($buffer);
}
});
}
diff --git a/generator/src/Method.php b/generator/src/Method.php
index d3406fd4..54eaa609 100644
--- a/generator/src/Method.php
+++ b/generator/src/Method.php
@@ -1,5 +1,7 @@
functionObject = $_functionObject;
- $this->rootEntity = $rootEntity;
- $this->moduleName = $moduleName;
- $this->errorType = $errorType;
$functionName = $this->getFunctionName();
- $this->phpstanSignarure = $phpStanFunctionMapReader->hasFunction($functionName) ? $phpStanFunctionMapReader->getFunction($functionName) : null;
- $this->returnType = $this->phpstanSignarure ? $this->phpstanSignarure->getReturnType() : new PhpStanType($this->functionObject->type->__toString());
+ $this->phpStanFunction = $phpStanFunctionMapReader->hasFunction($functionName) ? $phpStanFunctionMapReader->getFunction($functionName) : null;
+ $this->phpStanType = $this->phpStanFunction instanceof \Safe\PhpStanFunctions\PhpStanFunction ? $this->phpStanFunction->getReturnType() : new PhpStanType($this->functionObject->type->__toString());
}
public function getFunctionName(): string
@@ -64,7 +47,7 @@ public function getErrorType(): int
public function getSignatureReturnType(): string
{
- return $this->returnType->getSignatureType($this->errorType);
+ return $this->phpStanType->getSignatureType($this->errorType);
}
/**
@@ -73,41 +56,45 @@ public function getSignatureReturnType(): string
public function getParams(): array
{
if ($this->params === null) {
- if (!isset($this->functionObject->methodparam)) {
+ if (!property_exists($this->functionObject, 'methodparam') || $this->functionObject->methodparam === null) {
return [];
}
- $phpStanFunction = $this->phpstanSignarure;
+
+ $phpStanFunction = $this->phpStanFunction;
$params = [];
- $i=1;
+ $i = 1;
foreach ($this->functionObject->methodparam as $param) {
- $notes = $this->stripReturnFalseText($this->getStringForXPath("(//docbook:refsect1[@role='parameters']//docbook:varlistentry)[$i]//docbook:note//docbook:para"));
+ $notes = $this->stripReturnFalseText($this->getStringForXPath(sprintf("(//docbook:refsect1[@role='parameters']//docbook:varlistentry)[%d]//docbook:note//docbook:para", $i)));
$i++;
if (preg_match('/This parameter has been removed in PHP (\d+\.\d+\.\d+)/', $notes, $matches)) {
$removedVersion = $matches[1];
[$major, $minor] = explode('.', $removedVersion);
- if ($major < 7 || ($major == 7 && $minor == 0)) {
+ if ($major < 7) {
+ // Ignore parameter if it was removed before PHP 7.1
+ continue;
+ }
+
+ if ($major == 7 && $minor == 0) {
// Ignore parameter if it was removed before PHP 7.1
continue;
}
}
- $params[] = new Parameter($param, $phpStanFunction, $i-2);
+ $params[] = new Parameter($param, $phpStanFunction, $i - 2);
}
+
$this->params = $params;
}
+
return $this->params;
}
public function getPhpDoc(): string
{
- $str = "\n/**\n".
- implode("\n", array_map(function (string $line) {
- return rtrim(' * '.ltrim($line));
- }, \explode("\n", \strip_tags($this->getDocBlock()))))
- ."\n */\n";
-
- return $str;
+ return "\n/**\n" .
+ implode("\n", array_map(fn(string $line): string => rtrim(' * ' . ltrim($line)), \explode("\n", \strip_tags($this->getDocBlock()))))
+ . "\n */\n";
}
private function getDocBlock(): string
@@ -115,18 +102,16 @@ private function getDocBlock(): string
$str = $this->stripReturnFalseText($this->getStringForXPath("//docbook:refsect1[@role='description']/docbook:para"));
$str .= "\n\n";
- $i=1;
+ $i = 1;
foreach ($this->getParams() as $parameter) {
- $str .= '@param '.$parameter->getDocBlockType().' $'.$parameter->getParameterName().' ';
- $str .= $this->getStringForXPath("(//docbook:refsect1[@role='parameters']//docbook:varlistentry)[$i]//docbook:para")."\n";
+ $str .= '@param ' . $parameter->getDocBlockType() . ' $' . $parameter->getParameterName() . ' ';
+ $str .= $this->getStringForXPath(sprintf("(//docbook:refsect1[@role='parameters']//docbook:varlistentry)[%d]//docbook:para", $i)) . "\n";
$i++;
}
$str .= $this->getReturnDocBlock();
- $str .= '@throws '.FileCreator::toExceptionName($this->getModuleName()). "\n";
-
- return $str;
+ return $str . ('@throws ' . FileCreator::toExceptionName($this->getModuleName()) . "\n");
}
public function getReturnDocBlock(): string
@@ -136,8 +121,9 @@ public function getReturnDocBlock(): string
$bestReturnType = $this->getDocBlockReturnType();
if ($bestReturnType !== 'void') {
- return '@return '.$bestReturnType. ' ' .$returnDoc."\n";
+ return '@return ' . $bestReturnType . ' ' . $returnDoc . "\n";
}
+
return '';
}
@@ -150,7 +136,7 @@ private function stripReturnFalseText(string $string): string
$string = $this->removeString($string, ' and NULL on failure');
$string = $this->removeString($string, ' or NULL on failure');
break;
-
+
case self::FALSY_TYPE:
$string = $this->removeString($string, 'or FALSE on failure');
$string = $this->removeString($string, '. Returns FALSE on error');
@@ -181,29 +167,32 @@ private function stripReturnFalseText(string $string): string
private function removeString(string $string, string $search): string
{
$search = str_replace(' ', '\s+', $search);
- $result = preg_replace('/[\s\,]*'.$search.'/m', '', $string);
+ $result = preg_replace('/[\s\,]*' . $search . '/m', '', $string);
if ($result === null) {
throw new \RuntimeException('An error occurred while calling preg_replace');
}
+
return $result;
}
private function getStringForXPath(string $xpath): string
{
$paragraphs = $this->rootEntity->xpath($xpath);
- if ($paragraphs === false) {
+ if ($paragraphs === false || $paragraphs === null) {
throw new \RuntimeException('Error while performing Xpath request.');
}
+
$str = '';
foreach ($paragraphs as $paragraph) {
- $str .= $this->getInnerXml($paragraph)."\n\n";
+ $str .= $this->getInnerXml($paragraph) . "\n\n";
}
+
return trim($str);
}
private function getDocBlockReturnType(): string
{
- return $this->returnType->getDocBlockType($this->errorType);
+ return $this->phpStanType->getDocBlockType($this->errorType);
}
private function getInnerXml(\SimpleXMLElement $SimpleXMLElement): string
@@ -213,9 +202,9 @@ private function getInnerXml(\SimpleXMLElement $SimpleXMLElement): string
if ($inner_xml === false) {
throw new \RuntimeException('Unable to serialize to XML');
}
- $inner_xml = str_replace(['<'.$element_name.'>', ''.$element_name.'>'], '', $inner_xml);
- $inner_xml = trim($inner_xml);
- return $inner_xml;
+
+ $inner_xml = str_replace(['<' . $element_name . '>', '' . $element_name . '>'], '', $inner_xml);
+ return trim($inner_xml);
}
public function getModuleName(): string
@@ -225,8 +214,6 @@ public function getModuleName(): string
/**
* The function is overloaded if at least one parameter is optional with no default value and this parameter is not by reference.
- *
- * @return bool
*/
public function isOverloaded(): bool
{
@@ -235,6 +222,7 @@ public function isOverloaded(): bool
return true;
}
}
+
return false;
}
diff --git a/generator/src/Parameter.php b/generator/src/Parameter.php
index 4add27d8..77405dfe 100644
--- a/generator/src/Parameter.php
+++ b/generator/src/Parameter.php
@@ -1,4 +1,7 @@
parameter = $parameter;
- $phpStanParam = $phpStanFunction ? $phpStanFunction->getParameter($this->getParameterName(), $position) : null;
-
- $this->type = $phpStanParam ? $phpStanParam->getType() : new PhpStanType($this->parameter->type->__toString()); //todo: is this if useful?
+ $phpStanParam = $phpStanFunction instanceof \Safe\PhpStanFunctions\PhpStanFunction ? $phpStanFunction->getParameter($this->getParameterName(), $position) : null;
+ $this->phpStanType = $phpStanParam instanceof \Safe\PhpStanFunctions\PhpStanParameter ? $phpStanParam->getType() : new PhpStanType($this->parameter->type->__toString()); //todo: is this if useful?
}
/**
@@ -29,7 +23,7 @@ public function __construct(\SimpleXMLElement $parameter, ?PhpStanFunction $phpS
*/
public function getSignatureType(): string
{
- return $this->type->getSignatureType();
+ return $this->phpStanType->getSignatureType();
}
/**
@@ -37,19 +31,17 @@ public function getSignatureType(): string
*/
public function getDocBlockType(): string
{
- return $this->type->getDocBlockType();
+ return $this->phpStanType->getDocBlockType();
}
public function getParameterName(): string
{
- // The db2_bind_param method has parameters with a dash in it... yep... (patch submitted)
- return \str_replace('-', '_', $this->parameter->parameter->__toString());
+ return $this->parameter->parameter->__toString();
}
-
+
public function getParameterType(): string
{
- // The db2_bind_param method has parameters with a dash in it... yep... (patch submitted)
- return \str_replace('-', '_', $this->parameter->type->__toString());
+ return $this->parameter->type->__toString();
}
public function isByReference(): bool
@@ -60,24 +52,20 @@ public function isByReference(): bool
/**
* Some parameters can be optional with no default value. In this case, the function is "overloaded" (which is not
* possible in user-land but possible in core...)
- *
- * @return bool
*/
public function isOptionalWithNoDefault(): bool
{
if (((string)$this->parameter['choice']) !== 'opt' && !$this->isVariadic()) {
return false;
}
+
if (!$this->hasDefaultValue()) {
return true;
}
$initializer = $this->getInitializer();
// Some default value have weird values. For instance, first parameter of "mb_internal_encoding" has default value "mb_internal_encoding()"
- if ($initializer === 'null' || ($initializer !== 'array()' && strpos($initializer, '(') !== false)) {
- return true;
- }
- return false;
+ return $initializer === 'null' || ($initializer !== 'array()' && str_contains($initializer, '('));
}
public function isVariadic(): bool
@@ -87,7 +75,15 @@ public function isVariadic(): bool
public function isNullable(): bool
{
- return $this->type->isNullable();
+ if ($this->phpStanType->isNullable()) {
+ return true;
+ }
+
+ if ($this->getDefaultValue() === "null") {
+ return true;
+ }
+
+ return $this->getDefaultValue() === "NULL";
}
/*
@@ -100,7 +96,7 @@ public function getInitializer(): string
public function hasDefaultValue(): bool
{
- return isset($this->parameter->initializer);
+ return property_exists($this->parameter, 'initializer') && $this->parameter->initializer !== null;
}
public function getDefaultValue(): ?string
@@ -110,9 +106,8 @@ public function getDefaultValue(): ?string
}
$initializer = $this->getInitializer();
-
- // Some default value have weird values. For instance, first parameter of "mb_internal_encoding" has default value "mb_internal_encoding()"
- if (strpos($initializer, '(') !== false) {
+// Some default value have weird values. For instance, first parameter of "mb_internal_encoding" has default value "mb_internal_encoding()"
+ if (str_contains($initializer, '(')) {
return null;
}
@@ -126,8 +121,8 @@ private function getInnerXml(\SimpleXMLElement $SimpleXMLElement): string
if ($inner_xml === false) {
throw new \RuntimeException('Unable to serialize to XML');
}
- $inner_xml = str_replace(['<'.$element_name.'>', ''.$element_name.'>', '<'.$element_name.'/>'], '', $inner_xml);
- $inner_xml = trim($inner_xml);
- return $inner_xml;
+
+ $inner_xml = str_replace(['<' . $element_name . '>', '' . $element_name . '>', '<' . $element_name . '/>'], '', $inner_xml);
+ return trim($inner_xml);
}
}
diff --git a/generator/src/PhpStanFunctions/PhpStanFunction.php b/generator/src/PhpStanFunctions/PhpStanFunction.php
index c6054de2..5b6189fc 100644
--- a/generator/src/PhpStanFunctions/PhpStanFunction.php
+++ b/generator/src/PhpStanFunctions/PhpStanFunction.php
@@ -1,19 +1,17 @@
returnType = new PhpStanType(\array_shift($signature));
+
+ $this->phpStanType = new PhpStanType(\array_shift($signature));
foreach ($signature as $name => $type) {
$param = new PhpStanParameter($name, $type);
$this->parameters[$param->getName()] = $param;
}
}
-
+
public function getReturnType(): PhpStanType
{
- return $this->returnType;
+ return $this->phpStanType;
}
/**
diff --git a/generator/src/PhpStanFunctions/PhpStanFunctionMapReader.php b/generator/src/PhpStanFunctions/PhpStanFunctionMapReader.php
index f6987fd1..bc4b0382 100644
--- a/generator/src/PhpStanFunctions/PhpStanFunctionMapReader.php
+++ b/generator/src/PhpStanFunctions/PhpStanFunctionMapReader.php
@@ -1,5 +1,6 @@
functionMap = require 'phar://'.__DIR__.'/../../vendor/phpstan/phpstan/phpstan.phar/resources/functionMap.php';
+ $this->functionMap = require 'phar://' . __DIR__ . '/../../vendor/phpstan/phpstan/phpstan.phar/resources/functionMap.php';
$this->customFunctionMap = require __DIR__ . '/../../config/CustomPhpStanFunctionMap.php';
}
@@ -32,10 +33,12 @@ public function getFunction(string $functionName): PhpStanFunction
$customMap = $this->customFunctionMap[$functionName] ?? null;
if ($map && $customMap) {
if ($customMap === $map) {
- throw new \RuntimeException("Useless custom function map $functionName: ".var_export($customMap, true)."\nPlease delete this line from the custom file");
+ throw new \RuntimeException(sprintf('Useless custom function map %s: ', $functionName) . var_export($customMap, true) . "\nPlease delete this line from the custom file");
}
+
$map = $customMap;
}
+
return new PhpStanFunction($map);
}
}
diff --git a/generator/src/PhpStanFunctions/PhpStanParameter.php b/generator/src/PhpStanFunctions/PhpStanParameter.php
index 16deedaf..ac5aa4fb 100644
--- a/generator/src/PhpStanFunctions/PhpStanParameter.php
+++ b/generator/src/PhpStanFunctions/PhpStanParameter.php
@@ -1,5 +1,6 @@
name = $name;
- $this->type = new PhpStanType($type, $writeOnly);
+
+ $this->phpStanType = new PhpStanType($type, $writeOnly);
}
- /**
- * @return string
- */
public function getName(): string
{
return $this->name;
@@ -39,6 +34,6 @@ public function getName(): string
public function getType(): PhpStanType
{
- return $this->type;
+ return $this->phpStanType;
}
}
diff --git a/generator/src/PhpStanFunctions/PhpStanType.php b/generator/src/PhpStanFunctions/PhpStanType.php
index bf0e8fdb..17600218 100644
--- a/generator/src/PhpStanFunctions/PhpStanType.php
+++ b/generator/src/PhpStanFunctions/PhpStanType.php
@@ -1,5 +1,6 @@
types = ['null'];
return;
}
+
//first we try to parse the type string to have a list as clean as possible.
$nullable = false;
$falsable = false;
@@ -49,43 +48,69 @@ public function __construct(string $data, bool $writeOnly = false)
$returnTypes = $this->explodeTypes($data);
//remove 'null' from the list to identify if the signature type should be nullable
- if (($nullablePosition = \array_search('null', $returnTypes)) !== false) {
+ if (($nullablePosition = \array_search('null', $returnTypes, true)) !== false) {
$nullable = true;
\array_splice($returnTypes, (int) $nullablePosition, 1);
}
+
//remove 'false' from the list to identify if the function return false on error
- if (($falsablePosition = \array_search('false', $returnTypes)) !== false) {
+ if (($falsablePosition = \array_search('false', $returnTypes, true)) !== false) {
$falsable = true;
\array_splice($returnTypes, (int) $falsablePosition, 1);
}
+
/** @var int $count */
$count = \count($returnTypes);
if ($count === 0) {
- throw new \RuntimeException('Error when trying to extract parameter type');
+ $returnType = '';
}
+
foreach ($returnTypes as &$returnType) {
$pos = \strpos($returnType, '?');
if ($pos !== false) {
$nullable = true;
$returnType = \str_replace('?', '', $returnType);
}
- //remove the parenthesis only if we are not dealing with a callable
- if (\strpos($returnType, 'callable') === false) {
+
+ // remove the parenthesis only if we are not dealing with a callable
+ if (str_contains($returnType, 'callable') === false) {
$returnType = \str_replace(['(', ')'], '', $returnType);
}
- //here we deal with some weird phpstan typings
- if ($returnType === 'non-empty-string') {
+
+ // here we deal with some weird phpstan typings
+ if (str_contains($returnType, 'non-falsy-string')) {
+ $returnType = 'string';
+ }
+
+ if (str_contains($returnType, 'non-empty-string')) {
+ $returnType = 'string';
+ }
+
+ if (str_contains($returnType, '__stringAndStringable')) {
$returnType = 'string';
- } elseif ($returnType === 'positive-int') {
+ }
+
+ if ($returnType === 'positive-int') {
$returnType = 'int';
} elseif (is_numeric($returnType)) {
$returnType = 'int';
}
- if (\strpos($returnType, 'list<') !== false) {
+
+ if (str_contains($returnType, 'list<')) {
$returnType = \str_replace('list', 'array', $returnType);
}
+
+ if (str_contains($returnType, 'int<')) {
+ $returnType = 'int';
+ }
+
+ if (\preg_match('/__benevolent\<(.*)\>/', $returnType, $regs)) {
+ $returnType = $regs[1];
+ }
+
$returnType = Type::toRootNamespace($returnType);
}
+
$this->types = array_unique($returnTypes);
$this->nullable = $nullable;
$this->falsable = $falsable;
@@ -100,12 +125,14 @@ public function getDocBlockType(?int $errorType = null): string
} elseif ($this->nullable && $errorType !== Method::NULLSY_TYPE) {
$returnTypes[] = 'null';
}
- $type = join('|', $returnTypes);
+
+ $type = implode('|', $returnTypes);
if ($type === 'bool' && !$this->nullable && $errorType === Method::FALSY_TYPE) {
// If the function only returns a boolean, since false is for error, true is for success.
// Let's replace this with a "void".
return 'void';
}
+
return $type;
}
@@ -116,20 +143,20 @@ public function getSignatureType(?int $errorType = null): string
$falsable = $errorType === Method::FALSY_TYPE ? false : $this->falsable;
$types = $this->types;
//no typehint exists for thoses cases
- if (\array_intersect(self::NO_SIGNATURE_TYPES, $types)) {
+ if (\array_intersect(self::NO_SIGNATURE_TYPES, $types) !== []) {
return '';
}
foreach ($types as &$type) {
if (\strpos($type, 'callable(') > -1) {
$type = 'callable'; //strip callable type of its possible parenthesis and return (ex: callable(): void)
- } elseif (\strpos($type, 'array<') !== false || \strpos($type, 'array{') !== false) {
+ } elseif (str_contains($type, 'array<') || str_contains($type, 'array{')) {
$type = 'array'; //typed array has to be untyped
- } elseif (\strpos($type, '[]') !== false) {
+ } elseif (str_contains($type, '[]')) {
$type = 'iterable'; //generics cannot be typehinted and have to be turned into iterable
- } elseif (\strpos($type, 'resource') !== false) {
+ } elseif (str_contains($type, 'resource')) {
$type = ''; // resource cant be typehinted
- } elseif (\strpos($type, 'null') !== false) {
+ } elseif (str_contains($type, 'null')) {
$type = ''; // null is a real typehint
}
}
@@ -137,18 +164,21 @@ public function getSignatureType(?int $errorType = null): string
//if there are several distinct types, no typehint (we use distinct in case doc block contains several times the same type, for example array|array)
if (count(array_unique($types)) > 1) {
return '';
- } elseif (\in_array('void', $types) || (count($types) === 0 && !$nullable && !$falsable)) {
+ }
+
+ if (\in_array('void', $types) || ($types === [] && !$nullable && !$falsable)) {
return 'void';
}
- $finalType = $types[0];
+ $finalType = $types[0] ?? '';
if ($finalType === 'bool' && !$nullable && $errorType === Method::FALSY_TYPE) {
// If the function only returns a boolean, since false is for error, true is for success.
// Let's replace this with a "void".
return 'void';
}
- return ($nullable !== false ? '?' : '').$finalType;
+
+ return ($nullable ? '?' : '') . $finalType;
}
public function isNullable(): bool
diff --git a/generator/src/ScanObjectsCommand.php b/generator/src/ScanObjectsCommand.php
index 330e08af..cc7fdb3d 100644
--- a/generator/src/ScanObjectsCommand.php
+++ b/generator/src/ScanObjectsCommand.php
@@ -1,5 +1,6 @@
getMethodsPaths();
- $res = $scanner->getMethods($paths);
+ $scannerResponse = $scanner->getMethods($paths);
- foreach ($res->methods as $function) {
+ foreach ($scannerResponse->methods as $function) {
$name = $function->getFunctionName();
- $output->writeln('Found method '.$name);
+ $output->writeln('Found method ' . $name);
}
- $output->writeln('These methods are overloaded: '.\implode(', ', $res->overloadedFunctions));
+ $output->writeln('These methods are overloaded: ' . \implode(', ', $scannerResponse->overloadedFunctions));
return 0;
}
}
diff --git a/generator/src/Scanner.php b/generator/src/Scanner.php
index 67835752..ea283bde 100644
--- a/generator/src/Scanner.php
+++ b/generator/src/Scanner.php
@@ -1,33 +1,30 @@
path = $path;
}
/**
@@ -36,7 +33,7 @@ public function __construct(string $path)
public function getFunctionsPaths(): array
{
$finder = new Finder();
- $finder->in($this->path.'*/functions/')->name('*.xml')->sortByName();
+ $finder->in($this->path . '*/functions/')->name('*.xml')->sortByName();
return iterator_to_array($finder);
}
@@ -64,6 +61,7 @@ private function getIgnoredFunctions(): array
$this->ignoredFunctions = array_merge($ignoredFunctions, $specialCaseFunctions);
}
+
return $this->ignoredFunctions;
}
@@ -74,8 +72,9 @@ private function getIgnoredFunctions(): array
private function getIgnoredModules(): array
{
if ($this->ignoredModules === null) {
- $this->ignoredModules = require __DIR__.'/../config/ignoredModules.php';
+ $this->ignoredModules = require __DIR__ . '/../config/ignoredModules.php';
}
+
return $this->ignoredModules;
}
@@ -92,15 +91,18 @@ public function getMethods(array $paths): ScannerResponse
$phpStanFunctionMapReader = new PhpStanFunctionMapReader();
$ignoredFunctions = $this->getIgnoredFunctions();
$ignoredFunctions = \array_combine($ignoredFunctions, $ignoredFunctions);
+
$ignoredModules = $this->getIgnoredModules();
$ignoredModules = \array_combine($ignoredModules, $ignoredModules);
+
foreach ($paths as $path) {
- $module = \basename(\dirname($path, 2));
+ $module = \basename(\dirname($path->getPath()));
+
if (isset($ignoredModules[$module])) {
continue;
}
- $docPage = new DocPage($path);
+ $docPage = new DocPage($path->getPathname());
$isFalsy = $docPage->detectFalsyFunction();
$isNullsy = $docPage->detectNullsyFunction();
$isEmpty = $docPage->detectEmptyFunction();
@@ -109,20 +111,18 @@ public function getMethods(array $paths): ScannerResponse
$functionObjects = $docPage->getMethodSynopsis();
if (count($functionObjects) > 1) {
- $overloadedFunctions = array_merge($overloadedFunctions, \array_map(function ($functionObject) {
- return $functionObject->methodname->__toString();
- }, $functionObjects));
- $overloadedFunctions = \array_filter($overloadedFunctions, function (string $functionName) use ($ignoredFunctions) {
- return !isset($ignoredFunctions[$functionName]);
- });
+ $overloadedFunctions = array_merge($overloadedFunctions, \array_map(fn($functionObject) => $functionObject->methodname->__toString(), $functionObjects));
+ $overloadedFunctions = \array_filter($overloadedFunctions, fn(string $functionName): bool => !isset($ignoredFunctions[$functionName]));
continue;
}
+
$rootEntity = $docPage->loadAndResolveFile();
foreach ($functionObjects as $functionObject) {
$function = new Method($functionObject, $rootEntity, $docPage->getModule(), $phpStanFunctionMapReader, $errorType);
if (isset($ignoredFunctions[$function->getFunctionName()])) {
continue;
}
+
$functions[] = $function;
}
}
diff --git a/generator/src/ScannerResponse.php b/generator/src/ScannerResponse.php
index 647db147..8c2e2505 100644
--- a/generator/src/ScannerResponse.php
+++ b/generator/src/ScannerResponse.php
@@ -1,28 +1,24 @@
methods = $methods;
- $this->overloadedFunctions = $overloadedFunctions;
+ public function __construct(
+ /**
+ * @readonly
+ */
+ public array $methods,
+ /**
+ * @readonly
+ */
+ public array $overloadedFunctions
+ ) {
}
}
diff --git a/generator/src/Type.php b/generator/src/Type.php
index b4569198..a25899c7 100644
--- a/generator/src/Type.php
+++ b/generator/src/Type.php
@@ -1,5 +1,6 @@
method = $method;
}
/*
@@ -19,11 +15,12 @@ public function __construct(Method $method)
*/
public function getPhpPrototypeFunction(): string
{
- if ($this->method->getFunctionName()) {
+ if ($this->method->getFunctionName() !== '' && $this->method->getFunctionName() !== '0') {
$returnType = $this->method->getSignatureReturnType();
- $returnType = $returnType ? ': '.$returnType : '';
- return 'function '.$this->method->getFunctionName().'('.$this->displayParamsWithType($this->method->getParams()).')'.$returnType.'{}';
+ $returnType = $returnType !== '' && $returnType !== '0' ? ': ' . $returnType : '';
+ return 'function ' . $this->method->getFunctionName() . '(' . $this->displayParamsWithType($this->method->getParams()) . ')' . $returnType . '{}';
}
+
return '';
}
@@ -32,9 +29,10 @@ public function getPhpPrototypeFunction(): string
*/
public function getPhpFunctionalFunction(): string
{
- if ($this->getPhpPrototypeFunction()) {
+ if ($this->getPhpPrototypeFunction() !== '' && $this->getPhpPrototypeFunction() !== '0') {
return $this->writePhpFunction();
}
+
return '';
}
@@ -45,11 +43,13 @@ private function writePhpFunction(): string
{
$phpFunction = $this->method->getPhpDoc();
$returnType = $this->method->getSignatureReturnType();
- $returnType = $returnType ? ': '.$returnType : '';
+ $returnType = $returnType !== '' && $returnType !== '0' ? ': ' . $returnType : '';
+
$returnStatement = '';
if ($this->method->getSignatureReturnType() !== 'void') {
$returnStatement = " return \$safeResult;\n";
}
+
$moduleName = $this->method->getModuleName();
$phpFunction .= "function {$this->method->getFunctionName()}({$this->displayParamsWithType($this->method->getParams())}){$returnType}
@@ -58,25 +58,27 @@ private function writePhpFunction(): string
";
if (!$this->method->isOverloaded()) {
- $phpFunction .= ' $safeResult = '.$this->printFunctionCall($this->method);
+ $phpFunction .= ' $safeResult = ' . $this->printFunctionCall($this->method);
} else {
$method = $this->method;
$inElse = false;
do {
- $lastParameter = $method->getParams()[count($method->getParams())-1];
+ $lastParameter = $method->getParams()[count($method->getParams()) - 1];
if ($inElse) {
$phpFunction .= ' else';
} else {
$phpFunction .= ' ';
}
+
if ($lastParameter->isVariadic()) {
$defaultValueToString = '[]';
} else {
$defaultValue = $lastParameter->getDefaultValue();
$defaultValueToString = $this->defaultValueToString($defaultValue);
}
- $phpFunction .= 'if ($'.$lastParameter->getParameterName().' !== '.$defaultValueToString.') {'."\n";
- $phpFunction .= ' $safeResult = '.$this->printFunctionCall($method)."\n";
+
+ $phpFunction .= 'if ($' . $lastParameter->getParameterName() . ' !== ' . $defaultValueToString . ') {' . "\n";
+ $phpFunction .= ' $safeResult = ' . $this->printFunctionCall($method) . "\n";
$phpFunction .= ' }';
$inElse = true;
$method = $method->cloneAndRemoveAParameter();
@@ -84,41 +86,33 @@ private function writePhpFunction(): string
break;
}
} while (true);
- $phpFunction .= ' else {'."\n";
- $phpFunction .= ' $safeResult = '.$this->printFunctionCall($method)."\n";
+
+ $phpFunction .= ' else {' . "\n";
+ $phpFunction .= ' $safeResult = ' . $this->printFunctionCall($method) . "\n";
$phpFunction .= ' }';
}
- $phpFunction .= $this->generateExceptionCode($moduleName, $this->method).$returnStatement. '}
-';
-
- return $phpFunction;
+ return $phpFunction . ($this->generateExceptionCode($moduleName, $this->method) . $returnStatement . '}
+');
}
- private function generateExceptionCode(string $moduleName, Method $method) : string
+ private function generateExceptionCode(string $moduleName, Method $method): string
{
- switch ($method->getErrorType()) {
- case Method::FALSY_TYPE:
- $errorValue = 'false';
- break;
- case Method::NULLSY_TYPE:
- $errorValue = 'null';
- break;
- case Method::EMPTY_TYPE:
- $errorValue = "''";
- break;
- default:
- throw new \LogicException("Method doesn't have an error type");
- }
+ $errorValue = match ($method->getErrorType()) {
+ Method::FALSY_TYPE => 'false',
+ Method::NULLSY_TYPE => 'null',
+ Method::EMPTY_TYPE => "''",
+ default => throw new \LogicException("Method doesn't have an error type"),
+ };
// Special case for CURL: we need the first argument of the method if this is a resource.
if ($moduleName === 'Curl') {
$params = $method->getParams();
- if (\count($params) > 0 && in_array($params[0]->getParameterType(), ['CurlHandle', 'CurlMultiHandle', 'CurlShareHandle'])) {
+ if ($params !== [] && in_array($params[0]->getParameterType(), ['CurlHandle', 'CurlMultiHandle', 'CurlShareHandle'])) {
$name = $params[0]->getParameterName();
return "
- if (\$safeResult === $errorValue) {
- throw CurlException::createFromPhpError(\$$name);
+ if (\$safeResult === {$errorValue}) {
+ throw CurlException::createFromPhpError(\${$name});
}
";
}
@@ -126,7 +120,7 @@ private function generateExceptionCode(string $moduleName, Method $method) : str
$exceptionName = FileCreator::toExceptionName($moduleName);
return "
- if (\$safeResult === $errorValue) {
+ if (\$safeResult === {$errorValue}) {
throw {$exceptionName}::createFromPhpError();
}
";
@@ -134,7 +128,6 @@ private function generateExceptionCode(string $moduleName, Method $method) : str
/**
* @param Parameter[] $params
- * @return string
*/
private function displayParamsWithType(array $params): string
{
@@ -142,49 +135,68 @@ private function displayParamsWithType(array $params): string
$optDetected = false;
foreach ($params as $param) {
- $paramAsString = $param->getSignatureType();
+ $paramAsString = '';
+ $typeDetected = false;
+
+ // parameters can not have type void
+ if ($param->getSignatureType() !== 'void') {
+ $paramAsString = $param->getSignatureType();
+ }
+
if ($paramAsString !== '') {
$paramAsString .= ' ';
+ if ($param->isNullable() && $paramAsString[0] !== "?") {
+ $paramAsString = "?" . $paramAsString;
+ }
+
+ $typeDetected = true;
}
$paramName = $param->getParameterName();
if ($param->isVariadic()) {
- $paramAsString .= ' ...$'.$paramName;
+ $paramAsString .= ' ...$' . $paramName;
} else {
if ($param->isByReference()) {
$paramAsString .= '&';
}
- $paramAsString .= '$'.$paramName;
+
+ $paramAsString .= '$' . $paramName;
}
if ($param->hasDefaultValue() || $param->isOptionalWithNoDefault()) {
$optDetected = true;
}
+
$defaultValue = $param->getDefaultValue();
if ($defaultValue !== null) {
- $paramAsString .= ' = '.$this->defaultValueToString($defaultValue);
+ $paramAsString .= ' = ' . $this->defaultValueToString($defaultValue);
} elseif ($optDetected && !$param->isVariadic()) {
$paramAsString .= ' = null';
+
+ if ($typeDetected && $paramAsString[0] !== "?") {
+ $paramAsString = "?" . $paramAsString;
+ }
}
+
$paramsAsString[] = $paramAsString;
}
- return implode(', ', $paramsAsString);
+ return str_replace('\\\\', '\\', implode(', ', $paramsAsString));
}
- private function printFunctionCall(Method $function): string
+ private function printFunctionCall(Method $method): string
{
- $functionCall = '\\'.$function->getFunctionName().'(';
- $functionCall .= implode(', ', \array_map(function (Parameter $parameter) {
+ $functionCall = '\\' . $method->getFunctionName() . '(';
+ $functionCall .= implode(', ', \array_map(function (Parameter $parameter): string {
$str = '';
if ($parameter->isVariadic()) {
$str = '...';
}
- return $str.'$'.$parameter->getParameterName();
- }, $function->getParams()));
- $functionCall .= ');';
- return $functionCall;
+
+ return $str . '$' . $parameter->getParameterName();
+ }, $method->getParams()));
+ return $functionCall . ');';
}
private function defaultValueToString(?string $defaultValue): string
@@ -192,9 +204,11 @@ private function defaultValueToString(?string $defaultValue): string
if ($defaultValue === null) {
return 'null';
}
+
if ($defaultValue === '') {
return "''";
}
+
return $defaultValue;
}
}
diff --git a/generator/tests/ComposerJsonEditorTest.php b/generator/tests/ComposerJsonEditorTest.php
index dc8b9441..9d7ba9d7 100644
--- a/generator/tests/ComposerJsonEditorTest.php
+++ b/generator/tests/ComposerJsonEditorTest.php
@@ -1,5 +1,6 @@
expectException(DatetimeException::class);
- $datetime = DateTimeImmutable::createFromFormat('lol', 'super');
+ DateTimeImmutable::createFromFormat('lol', 'super');
}
public function testConstructorPreserveTimeAndTimezone(): void
{
- $timezone = new \DateTimeZone('Pacific/Chatham');
- $datetime = new DateTimeImmutable('now', $timezone);
- $this->assertInstanceOf(DateTimeImmutable::class, $datetime);
- $this->assertEquals($timezone, $datetime->getTimezone());
+ $dateTimeZone = new \DateTimeZone('Pacific/Chatham');
+ $dateTimeImmutable = new DateTimeImmutable('now', $dateTimeZone);
+ $this->assertInstanceOf(DateTimeImmutable::class, $dateTimeImmutable);
+ $this->assertEquals($dateTimeZone, $dateTimeImmutable->getTimezone());
}
public function testCreateFromFormatPreserveTimeAndTimezone(): void
{
- $timezone = new \DateTimeZone('Pacific/Chatham');
- $datetime = DateTimeImmutable::createFromFormat('d-m-Y', '20-03-2006', $timezone);
+ $dateTimeZone = new \DateTimeZone('Pacific/Chatham');
+ $datetime = DateTimeImmutable::createFromFormat('d-m-Y', '20-03-2006', $dateTimeZone);
$this->assertInstanceOf(DateTimeImmutable::class, $datetime);
$this->assertEquals('20-03-2006', $datetime->format('d-m-Y'));
- $this->assertEquals($timezone, $datetime->getTimezone());
+ $this->assertEquals($dateTimeZone, $datetime->getTimezone());
}
public function testSafeDatetimeImmutableIsImmutable(): void
{
- $datetime1 = new DateTimeImmutable();
- $datetime2 = $datetime1->add(new \DateInterval('P1W'));
+ $dateTimeImmutable = new DateTimeImmutable();
+ $datetime2 = $dateTimeImmutable->add(new \DateInterval('P1W'));
- $this->assertNotSame($datetime1, $datetime2);
+ $this->assertNotSame($dateTimeImmutable, $datetime2);
}
public function testSetDate(): void
@@ -72,6 +73,7 @@ public function testModify(): void
$datetime = new \DateTimeImmutable();
$datetime = $datetime->setDate(2017, 4, 6);
$datetime = $datetime->modify('+1 day');
+
$safeDatime = new DateTimeImmutable();
$safeDatime = $safeDatime->setDate(2017, 4, 6);
$safeDatime = $safeDatime->modify('+1 day');
@@ -83,7 +85,7 @@ public function testSetTimestamp(): void
{
$datetime = new \DateTimeImmutable('2000-01-01');
$safeDatime = new DateTimeImmutable('2000-01-01');
- $datetime = $datetime = $datetime->setTimestamp(12);
+ $datetime = $datetime->setTimestamp(12);
$safeDatime = $safeDatime->setTimestamp(12);
$this->assertEquals($datetime->getTimestamp(), $safeDatime->getTimestamp());
@@ -91,11 +93,11 @@ public function testSetTimestamp(): void
public function testSetTimezone(): void
{
- $timezone = new \DateTimeZone('Pacific/Chatham');
+ $dateTimeZone = new \DateTimeZone('Pacific/Chatham');
$datetime = new \DateTimeImmutable('2000-01-01');
$safeDatime = new DateTimeImmutable('2000-01-01');
- $datetime = $datetime->setTimezone($timezone);
- $safeDatime = $safeDatime->setTimezone($timezone);
+ $datetime = $datetime->setTimezone($dateTimeZone);
+ $safeDatime = $safeDatime->setTimezone($dateTimeZone);
$this->assertEquals($datetime->getTimezone(), $safeDatime->getTimezone());
}
@@ -112,30 +114,30 @@ public function testSetTime(): void
public function testAdd(): void
{
- $interval = new \DateInterval('P1M');
+ $dateInterval = new \DateInterval('P1M');
$datetime = new \DateTimeImmutable('2000-01-01');
$safeDatime = new DateTimeImmutable('2000-01-01');
- $datetime = $datetime->add($interval);
- $safeDatime = $safeDatime->add($interval);
+ $datetime = $datetime->add($dateInterval);
+ $safeDatime = $safeDatime->add($dateInterval);
$this->assertEquals($datetime->getTimestamp(), $safeDatime->getTimestamp());
}
public function testSub(): void
{
- $interval = new \DateInterval('P1M');
+ $dateInterval = new \DateInterval('P1M');
$datetime = new \DateTimeImmutable('2000-01-01');
$safeDatime = new DateTimeImmutable('2000-01-01');
- $datetime = $datetime->sub($interval);
- $safeDatime = $safeDatime->sub($interval);
+ $datetime = $datetime->sub($dateInterval);
+ $safeDatime = $safeDatime->sub($dateInterval);
$this->assertEquals($datetime->getTimestamp(), $safeDatime->getTimestamp());
}
- public function testSerialize()
+ public function testSerialize(): void
{
- $timezone = new \DateTimeZone('Pacific/Chatham');
- $safeDatetime = DateTimeImmutable::createFromFormat('d-m-Y', '20-03-2006', $timezone);
+ $dateTimeZone = new \DateTimeZone('Pacific/Chatham');
+ $safeDatetime = DateTimeImmutable::createFromFormat('d-m-Y', '20-03-2006', $dateTimeZone);
/** @var DateTimeImmutable $newDatetime */
$newDatetime = unserialize(serialize($safeDatetime));
@@ -145,12 +147,12 @@ public function testSerialize()
public function testComparaison(): void
{
- $safeDateTime = new \Safe\DateTimeImmutable();
+ $dateTimeImmutable = new \Safe\DateTimeImmutable();
$phpDateTime = new \DateTimeImmutable();
- $timeLimit = \DateInterval::createFromDateString('2 hours');
+ $dateInterval = \DateInterval::createFromDateString('2 hours');
- $a = $safeDateTime->modify('+3 hours') < $safeDateTime->add($timeLimit);
- $b = $phpDateTime->modify('+3 hours') < $phpDateTime->add($timeLimit);
+ $a = $dateTimeImmutable->modify('+3 hours') < $dateTimeImmutable->add($dateInterval);
+ $b = $phpDateTime->modify('+3 hours') < $phpDateTime->add($dateInterval);
$this->assertEquals($b, $a);
}
@@ -159,20 +161,20 @@ public function testEquals(): void
$phpDateTime = new \DateTimeImmutable();
$safeDateTime1 = \Safe\DateTimeImmutable::createFromFormat('Y-m-d H:i:s.u', $phpDateTime->format('Y-m-d H:i:s.u'));
- $safeDateTime2 = new \Safe\DateTimeImmutable($safeDateTime1->format('Y-m-d H:i:s.u'));
+ $dateTimeImmutable = new \Safe\DateTimeImmutable($safeDateTime1->format('Y-m-d H:i:s.u'));
$this->assertEquals($phpDateTime, $safeDateTime1);
- $this->assertEquals($phpDateTime, $safeDateTime2);
- $this->assertEquals($safeDateTime1, $safeDateTime2);
+ $this->assertEquals($phpDateTime, $dateTimeImmutable);
+ $this->assertEquals($safeDateTime1, $dateTimeImmutable);
}
//DatePeriod corrupts our DateTimeImmutable by setting their inner to null.
//This bug cannot be solved without editing DatePeriod itself.
public function testDatePeriodBug(): void
{
- $start = new \Safe\DateTimeImmutable('2020-01-01');
+ $dateTimeImmutable = new \Safe\DateTimeImmutable('2020-01-01');
$end = (new \Safe\DateTimeImmutable('2020-01-03'))->modify('+1 day');
- $datePeriod = new \DatePeriod($start, new \DateInterval('P1D'), $end);
+ $datePeriod = new \DatePeriod($dateTimeImmutable, new \DateInterval('P1D'), $end);
/** @var DateTimeImmutable $date */
foreach ($datePeriod as $date) {
@@ -192,8 +194,8 @@ public function testSwitchBetweenRegularAndSafe(): void
public function testSwitchBetweenRegularAndSafe2(): void
{
- $d = new \Safe\DateTimeImmutable('2019-01-01');
- $d2 = \Safe\DateTimeImmutable::createFromRegular($d->getInnerDateTime());
- $this->assertSame($d->format('Y-m-d H:i:s.u'), $d2->format('Y-m-d H:i:s.u'));
+ $dateTimeImmutable = new \Safe\DateTimeImmutable('2019-01-01');
+ $d2 = \Safe\DateTimeImmutable::createFromRegular($dateTimeImmutable->getInnerDateTime());
+ $this->assertSame($dateTimeImmutable->format('Y-m-d H:i:s.u'), $d2->format('Y-m-d H:i:s.u'));
}
}
diff --git a/generator/tests/DateTimeTest.php b/generator/tests/DateTimeTest.php
index ce4bf502..fa6b4db8 100644
--- a/generator/tests/DateTimeTest.php
+++ b/generator/tests/DateTimeTest.php
@@ -1,5 +1,6 @@
expectException(DatetimeException::class);
- $datetime = DateTime::createFromFormat('lol', 'super');
+ DateTime::createFromFormat('lol', 'super');
}
public function testCreateFromFormatPreserveTimeAndTimezone(): void
{
- $timezone = new \DateTimeZone('Pacific/Chatham');
- $datetime = DateTime::createFromFormat('d-m-Y', '20-03-2006', $timezone);
+ $dateTimeZone = new \DateTimeZone('Pacific/Chatham');
+ $datetime = DateTime::createFromFormat('d-m-Y', '20-03-2006', $dateTimeZone);
$this->assertInstanceOf(DateTime::class, $datetime);
$this->assertEquals('20-03-2006', $datetime->format('d-m-Y'));
- $this->assertEquals($timezone, $datetime->getTimezone());
+ $this->assertEquals($dateTimeZone, $datetime->getTimezone());
}
public function testSetDate(): void
diff --git a/generator/tests/DeprecateCommandTest.php b/generator/tests/DeprecateCommandTest.php
index 2caf2548..75453db3 100644
--- a/generator/tests/DeprecateCommandTest.php
+++ b/generator/tests/DeprecateCommandTest.php
@@ -1,5 +1,6 @@
assertEquals('Exceptions/ApcException.php', DeprecateCommand::getExceptionFilePath('apc'));
}
-}
\ No newline at end of file
+}
diff --git a/generator/tests/DocPageTest.php b/generator/tests/DocPageTest.php
index 27760ea7..b0777bfa 100644
--- a/generator/tests/DocPageTest.php
+++ b/generator/tests/DocPageTest.php
@@ -1,12 +1,14 @@
assertTrue($pregMatch->detectFalsyFunction());
$this->assertFalse($implode->detectFalsyFunction());
$this->assertTrue($getCwd->detectFalsyFunction());
- $this->assertTrue($setTime->detectFalsyFunction());
+ $this->assertFalse($setTime->detectFalsyFunction());
$this->assertTrue($filesize->detectFalsyFunction());
- $this->assertTrue($mcryptDecrypt->detectFalsyFunction());
$this->assertTrue($fsockopen->detectFalsyFunction());
$this->assertFalse($arrayReplace->detectFalsyFunction());
- $this->assertTrue($date->detectFalsyFunction());
+ $this->assertFalse($date->detectFalsyFunction());
$this->assertTrue($classImplement->detectFalsyFunction());
$this->assertTrue($getHeaders->detectFalsyFunction());
$this->assertTrue($gzopen->detectFalsyFunction());
$this->assertTrue($fopen->detectFalsyFunction());
}
- public function testDetectNullsyFunction()
+ public function testDetectNullsyFunction(): void
{
- $implode = new DocPage(__DIR__ . '/../doc/doc-en/en/reference/strings/functions/implode.xml');
+ $docPage = new DocPage(__DIR__ . '/../doc/doc-en/en/reference/strings/functions/implode.xml');
- $this->assertFalse($implode->detectNullsyFunction());
+ $this->assertFalse($docPage->detectNullsyFunction());
}
- public function testDetectEmptyFunction()
+ public function testDetectEmptyFunction(): void
{
- $pgHost = new DocPage(__DIR__ . '/../doc/doc-en/en/reference/pgsql/functions/pg-host.xml');
+ $docPage = new DocPage(__DIR__ . '/../doc/doc-en/en/reference/pgsql/functions/pg-host.xml');
- $this->assertTrue($pgHost->detectEmptyFunction());
+ $this->assertTrue($docPage->detectEmptyFunction());
}
}
diff --git a/generator/tests/GeneratedFilesTest.php b/generator/tests/GeneratedFilesTest.php
index 021c3b70..b8b63b5e 100644
--- a/generator/tests/GeneratedFilesTest.php
+++ b/generator/tests/GeneratedFilesTest.php
@@ -1,5 +1,7 @@
assertSame('foo', sprintf('foo'));
+ $this->assertSame('foo', 'foo');
$this->assertSame('foobar', sprintf('foo%s', 'bar'));
$this->assertSame('foobarbaz', sprintf('foo%s%s', 'bar', 'baz'));
- set_error_handler(function () {
+ set_error_handler(function (): void {
});
try {
$this->expectException(\ArgumentCountError::class);
@@ -32,7 +34,7 @@ public function testSprintf()
}
}
- public function testPregMatch()
+ public function testPregMatch(): void
{
require_once __DIR__ . '/../../generated/pcre.php';
require_once __DIR__ . '/../../lib/Exceptions/SafeExceptionInterface.php';
@@ -46,7 +48,7 @@ public function testPregMatch()
$this->assertSame($originalMatches, $matches);
}
- public function testObjects()
+ public function testObjects(): void
{
require_once __DIR__ . '/../../lib/special_cases.php';
require_once __DIR__ . '/../../lib/Exceptions/SafeExceptionInterface.php';
@@ -76,7 +78,7 @@ public function testObjects()
* Tests that the limit parameter is nullable.
* See https://github.com/thecodingmachine/safe/issues/56
*/
- public function testPregSplit()
+ public function testPregSplit(): void
{
require_once __DIR__ . '/../../generated/pcre.php';
require_once __DIR__ . '/../../lib/Exceptions/SafeExceptionInterface.php';
@@ -90,7 +92,7 @@ public function testPregSplit()
/**
* Tests that parameters with "time()" default value are correctly handled.
*/
- public function testStrtotime()
+ public function testStrtotime(): void
{
require_once __DIR__ . '/../../generated/datetime.php';
require_once __DIR__ . '/../../lib/Exceptions/SafeExceptionInterface.php';
@@ -98,7 +100,7 @@ public function testStrtotime()
$this->assertSame(\strtotime('+1 day'), strtotime('+1 day'));
- set_error_handler(function () {
+ set_error_handler(function (): void {
});
try {
$this->expectException(DatetimeException::class);
@@ -111,7 +113,7 @@ public function testStrtotime()
/**
* Tests that parameters signature can be not passed. See https://github.com/thecodingmachine/safe/issues/86
*/
- public function testOpenSslSign()
+ public function testOpenSslSign(): void
{
require_once __DIR__ . '/../../generated/openssl.php';
require_once __DIR__ . '/../../lib/Exceptions/SafeExceptionInterface.php';
@@ -123,7 +125,7 @@ public function testOpenSslSign()
$this->assertSame($signature, $signatureSafe);
}
- public function testOpenSslEncrypt()
+ public function testOpenSslEncrypt(): void
{
$result = \openssl_encrypt(
'test',
diff --git a/generator/tests/MethodTest.php b/generator/tests/MethodTest.php
index 82723aae..9ef269ed 100644
--- a/generator/tests/MethodTest.php
+++ b/generator/tests/MethodTest.php
@@ -1,5 +1,7 @@
getMethodSynopsis();
@@ -16,7 +18,7 @@ public function testGetFunctionName()
$this->assertEquals('preg_match', $name);
}
- public function testGetFunctionType()
+ public function testGetFunctionType(): void
{
$docPage = new DocPage(__DIR__ . '/../doc/doc-en/en/reference/pcre/functions/preg-match.xml');
$xmlObject = $docPage->getMethodSynopsis();
@@ -25,7 +27,7 @@ public function testGetFunctionType()
$this->assertEquals('int', $type);
}
- public function testGetFunctionParam()
+ public function testGetFunctionParam(): void
{
$docPage = new DocPage(__DIR__ . '/../doc/doc-en/en/reference/pcre/functions/preg-match.xml');
$xmlObject = $docPage->getMethodSynopsis();
@@ -35,7 +37,7 @@ public function testGetFunctionParam()
$this->assertEquals('pattern', $params[0]->getParameterName());
}
- public function testGetTypeHintFromRessource()
+ public function testGetTypeHintFromResource(): void
{
$docPage = new DocPage(__DIR__ . '/../doc/doc-en/en/reference/strings/functions/sprintf.xml');
$xmlObject = $docPage->getMethodSynopsis();
@@ -43,7 +45,7 @@ public function testGetTypeHintFromRessource()
$params = $method->getParams();
$this->assertEquals('string', $params[0]->getDocBlockType());
$this->assertEquals('string', $params[0]->getSignatureType());
- $this->assertEquals('string|int|float|bool', $params[1]->getDocBlockType());
+ $this->assertEquals('string|int|float|bool|null', $params[1]->getDocBlockType());
$this->assertTrue($params[1]->isVariadic());
$this->assertEquals('', $params[1]->getSignatureType());
@@ -52,7 +54,7 @@ public function testGetTypeHintFromRessource()
$method = new Method($xmlObject[0], $docPage->loadAndResolveFile(), $docPage->getModule(), new PhpStanFunctionMapReader(), Method::FALSY_TYPE);
$params = $method->getParams();
$this->assertEquals('string', $params[0]->getDocBlockType());
- $this->assertEquals('callable', $params[1]->getDocBlockType());
+ $this->assertEquals('callable(array):string', $params[1]->getDocBlockType());
$this->assertEquals('string', $params[0]->getSignatureType());
$this->assertEquals('callable', $params[1]->getSignatureType());
@@ -74,7 +76,7 @@ public function testGetTypeHintFromRessource()
$this->assertEquals('\HashContext', $params[0]->getSignatureType());
}
- public function testImapOpen5Parameter()
+ public function testImapOpen5Parameter(): void
{
$docPage = new DocPage(__DIR__ . '/../doc/doc-en/en/reference/imap/functions/imap-open.xml');
$xmlObject = $docPage->getMethodSynopsis();
@@ -84,7 +86,7 @@ public function testImapOpen5Parameter()
$this->assertEquals('array', $params[5]->getSignatureType());
}
- public function testGetInitializer()
+ public function testGetInitializer(): void
{
$docPage = new DocPage(__DIR__ . '/../doc/doc-en/en/reference/apache/functions/apache-getenv.xml');
$xmlObject = $docPage->getMethodSynopsis();
diff --git a/generator/tests/PhpStanFunctions/PhpStanFunctionMapReaderTest.php b/generator/tests/PhpStanFunctions/PhpStanFunctionMapReaderTest.php
index 2af9fd3f..9c0b4a5c 100644
--- a/generator/tests/PhpStanFunctions/PhpStanFunctionMapReaderTest.php
+++ b/generator/tests/PhpStanFunctions/PhpStanFunctionMapReaderTest.php
@@ -1,5 +1,7 @@
assertTrue($mapReader->hasFunction('strpos'));
- $this->assertFalse($mapReader->hasFunction('foobar'));
+ $phpStanFunctionMapReader = new PhpStanFunctionMapReader();
+ $this->assertTrue($phpStanFunctionMapReader->hasFunction('strpos'));
+ $this->assertFalse($phpStanFunctionMapReader->hasFunction('foobar'));
}
public function testGet(): void
{
- $mapReader = new PhpStanFunctionMapReader();
- $function = $mapReader->getFunction('apcu_fetch');
+ $phpStanFunctionMapReader = new PhpStanFunctionMapReader();
+ $phpStanFunction = $phpStanFunctionMapReader->getFunction('apcu_fetch');
// 'apcu_fetch' => ['mixed', 'key'=>'string|string[]', '&w_success='=>'bool'],
- $this->assertSame('mixed', $function->getReturnType()->getDocBlockType());
- $parameters = $function->getParameters();
+ $this->assertSame('mixed', $phpStanFunction->getReturnType()->getDocBlockType());
+ $parameters = $phpStanFunction->getParameters();
$this->assertCount(2, $parameters);
$this->assertSame('success', $parameters['success']->getName());
$this->assertSame('bool|null', $parameters['success']->getType()->getDocBlockType());
diff --git a/generator/tests/PhpStanFunctions/PhpStanTypeTest.php b/generator/tests/PhpStanFunctions/PhpStanTypeTest.php
index 6db4e257..a22f9b16 100644
--- a/generator/tests/PhpStanFunctions/PhpStanTypeTest.php
+++ b/generator/tests/PhpStanFunctions/PhpStanTypeTest.php
@@ -1,5 +1,6 @@
assertEquals('array|string|int', $param->getDocBlockType());
- $this->assertEquals('', $param->getSignatureType());
+ $phpStanType = new PhpStanType('array|string|int');
+ $this->assertEquals('array|string|int', $phpStanType->getDocBlockType());
+ $this->assertEquals('', $phpStanType->getSignatureType());
}
public function testCallable(): void
{
- $param = new PhpStanType('callable(string): void');
- $this->assertEquals('callable(string): void', $param->getDocBlockType());
- $this->assertEquals('callable', $param->getSignatureType());
+ $phpStanType = new PhpStanType('callable(string): void');
+ $this->assertEquals('callable(string): void', $phpStanType->getDocBlockType());
+ $this->assertEquals('callable', $phpStanType->getSignatureType());
}
public function testGenerics(): void
@@ -79,39 +80,39 @@ public function testNullable(): void
public function testParenthesisOutsideOfCallable(): void
{
- $param = new PhpStanType('(?int)|(?string)');
- $this->assertEquals(true, $param->isNullable());
- $this->assertEquals('int|string|null', $param->getDocBlockType());
- $this->assertEquals('', $param->getSignatureType());
+ $phpStanType = new PhpStanType('(?int)|(?string)');
+ $this->assertEquals(true, $phpStanType->isNullable());
+ $this->assertEquals('int|string|null', $phpStanType->getDocBlockType());
+ $this->assertEquals('', $phpStanType->getSignatureType());
}
public function testFalsable(): void
{
- $param = new PhpStanType('string|false');
- $this->assertEquals(true, $param->isFalsable());
- $this->assertEquals('string|false', $param->getDocBlockType());
- $this->assertEquals('string', $param->getSignatureType());
+ $phpStanType = new PhpStanType('string|false');
+ $this->assertEquals(true, $phpStanType->isFalsable());
+ $this->assertEquals('string|false', $phpStanType->getDocBlockType());
+ $this->assertEquals('string', $phpStanType->getSignatureType());
}
public function testResource(): void
{
- $param = new PhpStanType('resource');
- $this->assertEquals('resource', $param->getDocBlockType());
- $this->assertEquals('', $param->getSignatureType());
+ $phpStanType = new PhpStanType('resource');
+ $this->assertEquals('resource', $phpStanType->getDocBlockType());
+ $this->assertEquals('', $phpStanType->getSignatureType());
}
public function testNamespace(): void
{
- $param = new PhpStanType('GMP');
- $this->assertEquals('\GMP', $param->getDocBlockType());
- $this->assertEquals('\GMP', $param->getSignatureType());
+ $phpStanType = new PhpStanType('GMP');
+ $this->assertEquals('\GMP', $phpStanType->getDocBlockType());
+ $this->assertEquals('\GMP', $phpStanType->getSignatureType());
}
public function testVoid(): void
{
$param = new PhpStanType('');
$this->assertEquals('', $param->getDocBlockType());
- $this->assertEquals('', $param->getSignatureType());
+ $this->assertEquals('void', $param->getSignatureType());
$param = new PhpStanType('void');
$this->assertEquals('void', $param->getDocBlockType());
@@ -153,44 +154,44 @@ public function testErrorTypeInteraction(): void
public function testDuplicateType(): void
{
- $param = new PhpStanType('array|array|array>');
- $this->assertEquals('array|array|array>', $param->getDocBlockType());
- $this->assertEquals('array', $param->getSignatureType());
+ $phpStanType = new PhpStanType('array|array|array>');
+ $this->assertEquals('array|array|array>', $phpStanType->getDocBlockType());
+ $this->assertEquals('array', $phpStanType->getSignatureType());
}
public function testNullOrFalseBecomingNull(): void
{
- $param = new PhpStanType('null|false');
- $this->assertEquals('null', $param->getDocBlockType(Method::FALSY_TYPE));
- $this->assertEquals('', $param->getSignatureType(Method::FALSY_TYPE));
+ $phpStanType = new PhpStanType('null|false');
+ $this->assertEquals('null', $phpStanType->getDocBlockType(Method::FALSY_TYPE));
+ $this->assertEquals('', $phpStanType->getSignatureType(Method::FALSY_TYPE));
}
public function testNotEmptyStringBecomingString(): void
{
- $param = new PhpStanType('non-empty-string|false');
- $this->assertEquals('string', $param->getDocBlockType(Method::FALSY_TYPE));
- $this->assertEquals('string', $param->getSignatureType(Method::FALSY_TYPE));
+ $phpStanType = new PhpStanType('non-empty-string|false');
+ $this->assertEquals('string', $phpStanType->getDocBlockType(Method::FALSY_TYPE));
+ $this->assertEquals('string', $phpStanType->getSignatureType(Method::FALSY_TYPE));
}
public function testPositiveIntBecomingInt(): void
{
- $param = new PhpStanType('positive-int');
- $this->assertEquals('int', $param->getDocBlockType());
- $this->assertEquals('int', $param->getSignatureType());
+ $phpStanType = new PhpStanType('positive-int');
+ $this->assertEquals('int', $phpStanType->getDocBlockType());
+ $this->assertEquals('int', $phpStanType->getSignatureType());
}
public function testListBecomingArray(): void
{
- $param = new PhpStanType('list|false');
- $this->assertEquals('array', $param->getDocBlockType(Method::FALSY_TYPE));
- $this->assertEquals('array', $param->getSignatureType(Method::FALSY_TYPE));
+ $phpStanType = new PhpStanType('list|false');
+ $this->assertEquals('array', $phpStanType->getDocBlockType(Method::FALSY_TYPE));
+ $this->assertEquals('array', $phpStanType->getSignatureType(Method::FALSY_TYPE));
}
public function testNumbersAreRemoved(): void
{
- $param = new PhpStanType('0|positive-int');
- $this->assertEquals('int', $param->getDocBlockType());
- $this->assertEquals('int', $param->getSignatureType());
+ $phpStanType = new PhpStanType('0|positive-int');
+ $this->assertEquals('int', $phpStanType->getDocBlockType());
+ $this->assertEquals('int', $phpStanType->getSignatureType());
}
}
diff --git a/generator/tests/ScannerTest.php b/generator/tests/ScannerTest.php
index 65babe38..f285ff46 100644
--- a/generator/tests/ScannerTest.php
+++ b/generator/tests/ScannerTest.php
@@ -1,5 +1,7 @@
getFunctionsPaths();
@@ -16,7 +18,7 @@ public function testGetMethodsPaths()
$this->assertArrayNotHasKey(__DIR__.'/../doc/doc-en/en/reference/spl/appenditerator/getarrayiterator.xml', $paths);
}
- public function testGetFunctionsPaths()
+ public function testGetFunctionsPaths(): void
{
$scanner = new Scanner(__DIR__ . '/../doc/doc-en/en/reference/');
$paths = $scanner->getMethodsPaths();
diff --git a/generator/tests/SpecialCasesTest.php b/generator/tests/SpecialCasesTest.php
index e5f97232..bbafbcd2 100644
--- a/generator/tests/SpecialCasesTest.php
+++ b/generator/tests/SpecialCasesTest.php
@@ -1,5 +1,7 @@
assertEquals(['test', 'test'], $data);
}
+
\fclose($handle);
}
- public function testFgetcsvReturnFalseonEndOfFile()
+ public function testFgetcsvReturnFalseonEndOfFile(): void
{
require_once __DIR__.'/../../lib/special_cases.php';
require_once __DIR__.'/../../lib/Exceptions/SafeExceptionInterface.php';
@@ -51,6 +54,7 @@ public function testFgetcsvReturnFalseonEndOfFile()
while (($data = fgetcsv($handle, 1000, ",")) !== false) {
$this->assertEquals(['test', 'test'], $data);
}
+
$this->assertEquals(false, $data);
\fclose($handle);
}
diff --git a/generator/tests/TypeTest.php b/generator/tests/TypeTest.php
index d2f69e6d..aecfaa6e 100644
--- a/generator/tests/TypeTest.php
+++ b/generator/tests/TypeTest.php
@@ -1,12 +1,14 @@
assertSame('\\stdClass', Type::toRootNamespace('stdClass'));
$this->assertSame('\\SimpleXMLElement', Type::toRootNamespace('SimpleXMLElement'));
diff --git a/generator/tests/rector/src/test.php b/generator/tests/rector/src/test.php
index 61b4bee7..5cb4b09a 100644
--- a/generator/tests/rector/src/test.php
+++ b/generator/tests/rector/src/test.php
@@ -1,3 +1,5 @@
'PREG_BAD_UTF8_OFFSET_ERROR',
PREG_JIT_STACKLIMIT_ERROR => 'PREG_JIT_STACKLIMIT_ERROR',
];
- $errMsg = $errorMap[preg_last_error()] ?? 'Unknown PCRE error: '.preg_last_error();
+ $errMsg = $errorMap[preg_last_error()] ?? 'Unknown PCRE error: ' . preg_last_error();
return new self($errMsg, \preg_last_error());
}
}
diff --git a/lib/Exceptions/SafeExceptionInterface.php b/lib/Exceptions/SafeExceptionInterface.php
index fbea6ad2..cc7f71fc 100644
--- a/lib/Exceptions/SafeExceptionInterface.php
+++ b/lib/Exceptions/SafeExceptionInterface.php
@@ -1,9 +1,7 @@
$depth User specified recursion depth.
* @param int $flags Bitmask of JSON decode options.
@@ -33,10 +34,10 @@
* @throws JsonException if the JSON cannot be decoded.
* @link http://www.php.net/manual/en/function.json-decode.php
*/
-function json_decode(string $json, bool $assoc = false, int $depth = 512, int $flags = 0): mixed
+function json_decode(string $json, bool $associative = false, int $depth = 512, int $flags = 0): mixed
{
- $data = \json_decode($json, $assoc, $depth, $flags);
- if (JSON_ERROR_NONE !== json_last_error()) {
+ $data = \json_decode($json, $associative, $depth, $flags);
+ if (!($flags & JSON_THROW_ON_ERROR) && JSON_ERROR_NONE !== json_last_error()) {
throw JsonException::createFromPhpError();
}
return $data;
@@ -157,7 +158,7 @@ function apcu_fetch($key)
* @throws PcreException
*
*/
-function preg_replace($pattern, $replacement, $subject, int $limit = -1, int &$count = null)
+function preg_replace($pattern, $replacement, $subject, int $limit = -1, ?int &$count = null)
{
error_clear_last();
$result = \preg_replace($pattern, $replacement, $subject, $limit, $count);
@@ -394,7 +395,6 @@ function fputcsv($stream, array $fields, string $separator = ",", string $enclos
{
error_clear_last();
if (PHP_VERSION_ID >= 80100) {
- /** @phpstan-ignore-next-line */
$result = \fputcsv($stream, $fields, $separator, $enclosure, $escape, $eol);
} else {
$result = \fputcsv($stream, $fields, $separator, $enclosure, $escape);
@@ -431,7 +431,7 @@ function fputcsv($stream, array $fields, string $separator = ",", string $enclos
* @throws FilesystemException
*
*/
-function fgetcsv($stream, int $length = null, string $separator = ",", string $enclosure = "\"", string $escape = "\\"): array|false
+function fgetcsv($stream, ?int $length = null, string $separator = ",", string $enclosure = "\"", string $escape = "\\"): array|false
{
error_clear_last();
$safeResult = \fgetcsv($stream, $length, $separator, $enclosure, $escape);
diff --git a/phpcs.xml.dist b/phpcs.xml.dist
index e2025189..628d9c5e 100644
--- a/phpcs.xml.dist
+++ b/phpcs.xml.dist
@@ -7,7 +7,7 @@
-
+
lib
diff --git a/phpstan.neon b/phpstan.neon
index d6b61d51..73518de6 100644
--- a/phpstan.neon
+++ b/phpstan.neon
@@ -1,5 +1,9 @@
parameters:
+ paths:
+ - ./lib
+ # The level 9 is the highest level (with check for mixed type)
+ level: 8
ignoreErrors:
# A lot of functions are in extensions so it is ok not to find those
includes:
- - vendor/thecodingmachine/phpstan-strict-rules/phpstan-strict-rules.neon
\ No newline at end of file
+ - vendor/thecodingmachine/phpstan-strict-rules/phpstan-strict-rules.neon
diff --git a/rector-migrate.php b/rector-migrate.php
index 8bd9d7bd..e94882d6 100644
--- a/rector-migrate.php
+++ b/rector-migrate.php
@@ -11,8 +11,6 @@
RenameFunctionRector::class,[ 'apache_getenv' => 'Safe\apache_getenv',
'apache_get_version' => 'Safe\apache_get_version',
'apache_lookup_uri' => 'Safe\apache_lookup_uri',
- 'apache_request_headers' => 'Safe\apache_request_headers',
- 'apache_response_headers' => 'Safe\apache_response_headers',
'apache_setenv' => 'Safe\apache_setenv',
'apcu_cache_info' => 'Safe\apcu_cache_info',
'apcu_cas' => 'Safe\apcu_cas',
@@ -21,8 +19,7 @@
'apcu_inc' => 'Safe\apcu_inc',
'apcu_sma_info' => 'Safe\apcu_sma_info',
'apc_fetch' => 'Safe\apc_fetch',
- 'array_walk_recursive' => 'Safe\array_walk_recursive',
- 'assert_options' => 'Safe\assert_options',
+ 'array_all' => 'Safe\array_all',
'base64_decode' => 'Safe\base64_decode',
'bindtextdomain' => 'Safe\bindtextdomain',
'bzclose' => 'Safe\bzclose',
@@ -39,14 +36,12 @@
'class_parents' => 'Safe\class_parents',
'class_uses' => 'Safe\class_uses',
'cli_set_process_title' => 'Safe\cli_set_process_title',
- 'closelog' => 'Safe\closelog',
'com_create_guid' => 'Safe\com_create_guid',
'com_event_sink' => 'Safe\com_event_sink',
'com_load_typelib' => 'Safe\com_load_typelib',
'com_print_typeinfo' => 'Safe\com_print_typeinfo',
'convert_uudecode' => 'Safe\convert_uudecode',
'copy' => 'Safe\copy',
- 'create_function' => 'Safe\create_function',
'cubrid_bind' => 'Safe\cubrid_bind',
'cubrid_column_names' => 'Safe\cubrid_column_names',
'cubrid_column_types' => 'Safe\cubrid_column_types',
@@ -107,19 +102,16 @@
'curl_getinfo' => 'Safe\curl_getinfo',
'curl_init' => 'Safe\curl_init',
'curl_multi_info_read' => 'Safe\curl_multi_info_read',
- 'curl_multi_init' => 'Safe\curl_multi_init',
'curl_multi_setopt' => 'Safe\curl_multi_setopt',
'curl_setopt' => 'Safe\curl_setopt',
- 'curl_share_errno' => 'Safe\curl_share_errno',
'curl_share_setopt' => 'Safe\curl_share_setopt',
'curl_unescape' => 'Safe\curl_unescape',
'curl_upkeep' => 'Safe\curl_upkeep',
- 'date' => 'Safe\date',
- 'date_parse' => 'Safe\date_parse',
+ 'date_create' => 'Safe\date_create',
+ 'date_create_immutable' => 'Safe\date_create_immutable',
'date_parse_from_format' => 'Safe\date_parse_from_format',
'date_sunrise' => 'Safe\date_sunrise',
'date_sunset' => 'Safe\date_sunset',
- 'date_sun_info' => 'Safe\date_sun_info',
'db2_autocommit' => 'Safe\db2_autocommit',
'db2_bind_param' => 'Safe\db2_bind_param',
'db2_client_info' => 'Safe\db2_client_info',
@@ -129,6 +121,7 @@
'db2_free_result' => 'Safe\db2_free_result',
'db2_free_stmt' => 'Safe\db2_free_stmt',
'db2_get_option' => 'Safe\db2_get_option',
+ 'db2_num_rows' => 'Safe\db2_num_rows',
'db2_pclose' => 'Safe\db2_pclose',
'db2_rollback' => 'Safe\db2_rollback',
'db2_server_info' => 'Safe\db2_server_info',
@@ -202,6 +195,7 @@
'finfo_open' => 'Safe\finfo_open',
'flock' => 'Safe\flock',
'fopen' => 'Safe\fopen',
+ 'fpm_get_status' => 'Safe\fpm_get_status',
'fputcsv' => 'Safe\fputcsv',
'fread' => 'Safe\fread',
'fsockopen' => 'Safe\fsockopen',
@@ -221,6 +215,7 @@
'ftp_login' => 'Safe\ftp_login',
'ftp_mkdir' => 'Safe\ftp_mkdir',
'ftp_mlsd' => 'Safe\ftp_mlsd',
+ 'ftp_nb_get' => 'Safe\ftp_nb_get',
'ftp_nb_put' => 'Safe\ftp_nb_put',
'ftp_nlist' => 'Safe\ftp_nlist',
'ftp_pasv' => 'Safe\ftp_pasv',
@@ -234,7 +229,6 @@
'ftp_systype' => 'Safe\ftp_systype',
'ftruncate' => 'Safe\ftruncate',
'fwrite' => 'Safe\fwrite',
- 'getallheaders' => 'Safe\getallheaders',
'getcwd' => 'Safe\getcwd',
'gethostname' => 'Safe\gethostname',
'getimagesize' => 'Safe\getimagesize',
@@ -252,8 +246,6 @@
'get_include_path' => 'Safe\get_include_path',
'get_meta_tags' => 'Safe\get_meta_tags',
'glob' => 'Safe\glob',
- 'gmmktime' => 'Safe\gmmktime',
- 'gmp_random_seed' => 'Safe\gmp_random_seed',
'gmstrftime' => 'Safe\gmstrftime',
'gnupg_adddecryptkey' => 'Safe\gnupg_adddecryptkey',
'gnupg_addencryptkey' => 'Safe\gnupg_addencryptkey',
@@ -271,20 +263,16 @@
'gzencode' => 'Safe\gzencode',
'gzfile' => 'Safe\gzfile',
'gzgets' => 'Safe\gzgets',
- 'gzgetss' => 'Safe\gzgetss',
'gzinflate' => 'Safe\gzinflate',
'gzopen' => 'Safe\gzopen',
- 'gzpassthru' => 'Safe\gzpassthru',
'gzread' => 'Safe\gzread',
'gzrewind' => 'Safe\gzrewind',
'gzuncompress' => 'Safe\gzuncompress',
'gzwrite' => 'Safe\gzwrite',
- 'hash_hkdf' => 'Safe\hash_hkdf',
'hash_update_file' => 'Safe\hash_update_file',
'header_register_callback' => 'Safe\header_register_callback',
'hex2bin' => 'Safe\hex2bin',
'highlight_file' => 'Safe\highlight_file',
- 'highlight_string' => 'Safe\highlight_string',
'hrtime' => 'Safe\hrtime',
'ibase_add_user' => 'Safe\ibase_add_user',
'ibase_backup' => 'Safe\ibase_backup',
@@ -313,7 +301,6 @@
'iconv_get_encoding' => 'Safe\iconv_get_encoding',
'iconv_set_encoding' => 'Safe\iconv_set_encoding',
'idate' => 'Safe\idate',
- 'image2wbmp' => 'Safe\image2wbmp',
'imageaffine' => 'Safe\imageaffine',
'imageaffinematrixconcat' => 'Safe\imageaffinematrixconcat',
'imageaffinematrixget' => 'Safe\imageaffinematrixget',
@@ -389,8 +376,6 @@
'imagesettile' => 'Safe\imagesettile',
'imagestring' => 'Safe\imagestring',
'imagestringup' => 'Safe\imagestringup',
- 'imagesx' => 'Safe\imagesx',
- 'imagesy' => 'Safe\imagesy',
'imagetruecolortopalette' => 'Safe\imagetruecolortopalette',
'imagettfbbox' => 'Safe\imagettfbbox',
'imagettftext' => 'Safe\imagettftext',
@@ -405,8 +390,6 @@
'imap_body' => 'Safe\imap_body',
'imap_bodystruct' => 'Safe\imap_bodystruct',
'imap_check' => 'Safe\imap_check',
- 'imap_clearflag_full' => 'Safe\imap_clearflag_full',
- 'imap_close' => 'Safe\imap_close',
'imap_createmailbox' => 'Safe\imap_createmailbox',
'imap_deletemailbox' => 'Safe\imap_deletemailbox',
'imap_fetchbody' => 'Safe\imap_fetchbody',
@@ -414,7 +397,6 @@
'imap_fetchmime' => 'Safe\imap_fetchmime',
'imap_fetchstructure' => 'Safe\imap_fetchstructure',
'imap_fetch_overview' => 'Safe\imap_fetch_overview',
- 'imap_gc' => 'Safe\imap_gc',
'imap_getacl' => 'Safe\imap_getacl',
'imap_getmailboxes' => 'Safe\imap_getmailboxes',
'imap_getsubscribed' => 'Safe\imap_getsubscribed',
@@ -423,7 +405,6 @@
'imap_listscan' => 'Safe\imap_listscan',
'imap_lsub' => 'Safe\imap_lsub',
'imap_mail' => 'Safe\imap_mail',
- 'imap_mailboxmsginfo' => 'Safe\imap_mailboxmsginfo',
'imap_mail_compose' => 'Safe\imap_mail_compose',
'imap_mail_copy' => 'Safe\imap_mail_copy',
'imap_mail_move' => 'Safe\imap_mail_move',
@@ -436,28 +417,25 @@
'imap_rfc822_write_address' => 'Safe\imap_rfc822_write_address',
'imap_savebody' => 'Safe\imap_savebody',
'imap_setacl' => 'Safe\imap_setacl',
- 'imap_setflag_full' => 'Safe\imap_setflag_full',
'imap_set_quota' => 'Safe\imap_set_quota',
'imap_sort' => 'Safe\imap_sort',
'imap_status' => 'Safe\imap_status',
'imap_subscribe' => 'Safe\imap_subscribe',
'imap_thread' => 'Safe\imap_thread',
'imap_timeout' => 'Safe\imap_timeout',
- 'imap_undelete' => 'Safe\imap_undelete',
'imap_unsubscribe' => 'Safe\imap_unsubscribe',
'imap_utf8_to_mutf7' => 'Safe\imap_utf8_to_mutf7',
'inet_ntop' => 'Safe\inet_ntop',
'inflate_add' => 'Safe\inflate_add',
'inflate_get_read_len' => 'Safe\inflate_get_read_len',
- 'inflate_get_status' => 'Safe\inflate_get_status',
'inflate_init' => 'Safe\inflate_init',
'ini_get' => 'Safe\ini_get',
'ini_set' => 'Safe\ini_set',
+ 'inotify_add_watch' => 'Safe\inotify_add_watch',
'inotify_init' => 'Safe\inotify_init',
'inotify_rm_watch' => 'Safe\inotify_rm_watch',
'iptcembed' => 'Safe\iptcembed',
'iptcparse' => 'Safe\iptcparse',
- 'jpeg2wbmp' => 'Safe\jpeg2wbmp',
'json_decode' => 'Safe\json_decode',
'json_encode' => 'Safe\json_encode',
'lchgrp' => 'Safe\lchgrp',
@@ -477,7 +455,6 @@
'ldap_first_attribute' => 'Safe\ldap_first_attribute',
'ldap_first_entry' => 'Safe\ldap_first_entry',
'ldap_free_result' => 'Safe\ldap_free_result',
- 'ldap_get_attributes' => 'Safe\ldap_get_attributes',
'ldap_get_dn' => 'Safe\ldap_get_dn',
'ldap_get_entries' => 'Safe\ldap_get_entries',
'ldap_get_option' => 'Safe\ldap_get_option',
@@ -497,7 +474,6 @@
'libxml_get_last_error' => 'Safe\libxml_get_last_error',
'libxml_set_external_entity_loader' => 'Safe\libxml_set_external_entity_loader',
'link' => 'Safe\link',
- 'long2ip' => 'Safe\long2ip',
'lstat' => 'Safe\lstat',
'lzf_compress' => 'Safe\lzf_compress',
'lzf_decompress' => 'Safe\lzf_decompress',
@@ -509,7 +485,6 @@
'mb_chr' => 'Safe\mb_chr',
'mb_convert_encoding' => 'Safe\mb_convert_encoding',
'mb_detect_order' => 'Safe\mb_detect_order',
- 'mb_encoding_aliases' => 'Safe\mb_encoding_aliases',
'mb_eregi_replace' => 'Safe\mb_eregi_replace',
'mb_ereg_replace' => 'Safe\mb_ereg_replace',
'mb_ereg_replace_callback' => 'Safe\mb_ereg_replace_callback',
@@ -571,6 +546,8 @@
'ob_end_clean' => 'Safe\ob_end_clean',
'ob_end_flush' => 'Safe\ob_end_flush',
'ob_flush' => 'Safe\ob_flush',
+ 'ob_get_clean' => 'Safe\ob_get_clean',
+ 'ob_get_flush' => 'Safe\ob_get_flush',
'ob_start' => 'Safe\ob_start',
'oci_bind_array_by_name' => 'Safe\oci_bind_array_by_name',
'oci_bind_by_name' => 'Safe\oci_bind_by_name',
@@ -610,7 +587,6 @@
'oci_statement_type' => 'Safe\oci_statement_type',
'oci_unregister_taf_callback' => 'Safe\oci_unregister_taf_callback',
'odbc_autocommit' => 'Safe\odbc_autocommit',
- 'odbc_binmode' => 'Safe\odbc_binmode',
'odbc_columnprivileges' => 'Safe\odbc_columnprivileges',
'odbc_columns' => 'Safe\odbc_columns',
'odbc_commit' => 'Safe\odbc_commit',
@@ -627,7 +603,6 @@
'odbc_field_type' => 'Safe\odbc_field_type',
'odbc_foreignkeys' => 'Safe\odbc_foreignkeys',
'odbc_gettypeinfo' => 'Safe\odbc_gettypeinfo',
- 'odbc_longreadlen' => 'Safe\odbc_longreadlen',
'odbc_pconnect' => 'Safe\odbc_pconnect',
'odbc_prepare' => 'Safe\odbc_prepare',
'odbc_primarykeys' => 'Safe\odbc_primarykeys',
@@ -644,7 +619,6 @@
'opcache_compile_file' => 'Safe\opcache_compile_file',
'opcache_get_status' => 'Safe\opcache_get_status',
'opendir' => 'Safe\opendir',
- 'openlog' => 'Safe\openlog',
'openssl_cipher_iv_length' => 'Safe\openssl_cipher_iv_length',
'openssl_cipher_key_length' => 'Safe\openssl_cipher_key_length',
'openssl_cms_decrypt' => 'Safe\openssl_cms_decrypt',
@@ -696,7 +670,6 @@
'openssl_x509_read' => 'Safe\openssl_x509_read',
'output_add_rewrite_var' => 'Safe\output_add_rewrite_var',
'output_reset_rewrite_vars' => 'Safe\output_reset_rewrite_vars',
- 'pack' => 'Safe\pack',
'parse_ini_file' => 'Safe\parse_ini_file',
'parse_ini_string' => 'Safe\parse_ini_string',
'parse_url' => 'Safe\parse_url',
@@ -744,14 +717,13 @@
'pg_result_error_field' => 'Safe\pg_result_error_field',
'pg_result_seek' => 'Safe\pg_result_seek',
'pg_select' => 'Safe\pg_select',
+ 'pg_set_chunked_rows_size' => 'Safe\pg_set_chunked_rows_size',
'pg_socket' => 'Safe\pg_socket',
'pg_trace' => 'Safe\pg_trace',
'pg_update' => 'Safe\pg_update',
- 'phpcredits' => 'Safe\phpcredits',
- 'phpinfo' => 'Safe\phpinfo',
'php_sapi_name' => 'Safe\php_sapi_name',
- 'png2wbmp' => 'Safe\png2wbmp',
'posix_access' => 'Safe\posix_access',
+ 'posix_eaccess' => 'Safe\posix_eaccess',
'posix_getgrgid' => 'Safe\posix_getgrgid',
'posix_getgrnam' => 'Safe\posix_getgrnam',
'posix_getgroups' => 'Safe\posix_getgroups',
@@ -780,7 +752,6 @@
'pspell_add_to_personal' => 'Safe\pspell_add_to_personal',
'pspell_add_to_session' => 'Safe\pspell_add_to_session',
'pspell_clear_session' => 'Safe\pspell_clear_session',
- 'pspell_config_create' => 'Safe\pspell_config_create',
'pspell_config_data_dir' => 'Safe\pspell_config_data_dir',
'pspell_config_dict_dir' => 'Safe\pspell_config_dict_dir',
'pspell_config_ignore' => 'Safe\pspell_config_ignore',
@@ -874,6 +845,33 @@
'rename' => 'Safe\rename',
'rewind' => 'Safe\rewind',
'rmdir' => 'Safe\rmdir',
+ 'rnp_decrypt' => 'Safe\rnp_decrypt',
+ 'rnp_dump_packets' => 'Safe\rnp_dump_packets',
+ 'rnp_dump_packets_to_json' => 'Safe\rnp_dump_packets_to_json',
+ 'rnp_ffi_create' => 'Safe\rnp_ffi_create',
+ 'rnp_ffi_set_pass_provider' => 'Safe\rnp_ffi_set_pass_provider',
+ 'rnp_import_keys' => 'Safe\rnp_import_keys',
+ 'rnp_import_signatures' => 'Safe\rnp_import_signatures',
+ 'rnp_key_export' => 'Safe\rnp_key_export',
+ 'rnp_key_export_autocrypt' => 'Safe\rnp_key_export_autocrypt',
+ 'rnp_key_export_revocation' => 'Safe\rnp_key_export_revocation',
+ 'rnp_key_get_info' => 'Safe\rnp_key_get_info',
+ 'rnp_key_remove' => 'Safe\rnp_key_remove',
+ 'rnp_key_revoke' => 'Safe\rnp_key_revoke',
+ 'rnp_list_keys' => 'Safe\rnp_list_keys',
+ 'rnp_load_keys' => 'Safe\rnp_load_keys',
+ 'rnp_load_keys_from_path' => 'Safe\rnp_load_keys_from_path',
+ 'rnp_locate_key' => 'Safe\rnp_locate_key',
+ 'rnp_op_encrypt' => 'Safe\rnp_op_encrypt',
+ 'rnp_op_generate_key' => 'Safe\rnp_op_generate_key',
+ 'rnp_op_sign' => 'Safe\rnp_op_sign',
+ 'rnp_op_sign_cleartext' => 'Safe\rnp_op_sign_cleartext',
+ 'rnp_op_sign_detached' => 'Safe\rnp_op_sign_detached',
+ 'rnp_op_verify' => 'Safe\rnp_op_verify',
+ 'rnp_op_verify_detached' => 'Safe\rnp_op_verify_detached',
+ 'rnp_save_keys' => 'Safe\rnp_save_keys',
+ 'rnp_save_keys_to_path' => 'Safe\rnp_save_keys_to_path',
+ 'rnp_supported_features' => 'Safe\rnp_supported_features',
'rpmaddtag' => 'Safe\rpmaddtag',
'rrd_create' => 'Safe\rrd_create',
'rrd_first' => 'Safe\rrd_first',
@@ -919,7 +917,6 @@
'shm_put_var' => 'Safe\shm_put_var',
'shm_remove' => 'Safe\shm_remove',
'shm_remove_var' => 'Safe\shm_remove_var',
- 'shuffle' => 'Safe\shuffle',
'simplexml_import_dom' => 'Safe\simplexml_import_dom',
'simplexml_load_file' => 'Safe\simplexml_load_file',
'simplexml_load_string' => 'Safe\simplexml_load_string',
@@ -927,6 +924,7 @@
'socket_addrinfo_bind' => 'Safe\socket_addrinfo_bind',
'socket_addrinfo_connect' => 'Safe\socket_addrinfo_connect',
'socket_addrinfo_lookup' => 'Safe\socket_addrinfo_lookup',
+ 'socket_atmark' => 'Safe\socket_atmark',
'socket_bind' => 'Safe\socket_bind',
'socket_connect' => 'Safe\socket_connect',
'socket_create' => 'Safe\socket_create',
@@ -950,6 +948,8 @@
'socket_wsaprotocol_info_export' => 'Safe\socket_wsaprotocol_info_export',
'socket_wsaprotocol_info_import' => 'Safe\socket_wsaprotocol_info_import',
'socket_wsaprotocol_info_release' => 'Safe\socket_wsaprotocol_info_release',
+ 'sodium_crypto_aead_aegis128l_decrypt' => 'Safe\sodium_crypto_aead_aegis128l_decrypt',
+ 'sodium_crypto_aead_aegis256_decrypt' => 'Safe\sodium_crypto_aead_aegis256_decrypt',
'sodium_crypto_aead_aes256gcm_decrypt' => 'Safe\sodium_crypto_aead_aes256gcm_decrypt',
'sodium_crypto_aead_chacha20poly1305_decrypt' => 'Safe\sodium_crypto_aead_chacha20poly1305_decrypt',
'sodium_crypto_aead_chacha20poly1305_encrypt' => 'Safe\sodium_crypto_aead_chacha20poly1305_encrypt',
@@ -960,7 +960,6 @@
'sodium_crypto_auth_verify' => 'Safe\sodium_crypto_auth_verify',
'sodium_crypto_box_open' => 'Safe\sodium_crypto_box_open',
'sodium_crypto_box_seal_open' => 'Safe\sodium_crypto_box_seal_open',
- 'sodium_crypto_generichash_update' => 'Safe\sodium_crypto_generichash_update',
'sodium_crypto_secretbox_open' => 'Safe\sodium_crypto_secretbox_open',
'sodium_crypto_sign_open' => 'Safe\sodium_crypto_sign_open',
'sodium_crypto_sign_verify_detached' => 'Safe\sodium_crypto_sign_verify_detached',
@@ -1009,6 +1008,7 @@
'ssh2_sftp_symlink' => 'Safe\ssh2_sftp_symlink',
'ssh2_sftp_unlink' => 'Safe\ssh2_sftp_unlink',
'ssh2_shell' => 'Safe\ssh2_shell',
+ 'stream_context_set_options' => 'Safe\stream_context_set_options',
'stream_context_set_params' => 'Safe\stream_context_set_params',
'stream_copy_to_stream' => 'Safe\stream_copy_to_stream',
'stream_filter_append' => 'Safe\stream_filter_append',
@@ -1044,7 +1044,6 @@
'swoole_event_del' => 'Safe\swoole_event_del',
'swoole_event_write' => 'Safe\swoole_event_write',
'symlink' => 'Safe\symlink',
- 'syslog' => 'Safe\syslog',
'system' => 'Safe\system',
'tempnam' => 'Safe\tempnam',
'timezone_name_from_abbr' => 'Safe\timezone_name_from_abbr',
@@ -1071,16 +1070,7 @@
'xdiff_string_patch_binary' => 'Safe\xdiff_string_patch_binary',
'xmlrpc_set_type' => 'Safe\xmlrpc_set_type',
'xml_parser_free' => 'Safe\xml_parser_free',
- 'xml_set_character_data_handler' => 'Safe\xml_set_character_data_handler',
- 'xml_set_default_handler' => 'Safe\xml_set_default_handler',
- 'xml_set_element_handler' => 'Safe\xml_set_element_handler',
- 'xml_set_end_namespace_decl_handler' => 'Safe\xml_set_end_namespace_decl_handler',
- 'xml_set_external_entity_ref_handler' => 'Safe\xml_set_external_entity_ref_handler',
- 'xml_set_notation_decl_handler' => 'Safe\xml_set_notation_decl_handler',
- 'xml_set_object' => 'Safe\xml_set_object',
- 'xml_set_processing_instruction_handler' => 'Safe\xml_set_processing_instruction_handler',
- 'xml_set_start_namespace_decl_handler' => 'Safe\xml_set_start_namespace_decl_handler',
- 'xml_set_unparsed_entity_decl_handler' => 'Safe\xml_set_unparsed_entity_decl_handler',
+ 'xml_parser_set_option' => 'Safe\xml_parser_set_option',
'yaml_parse' => 'Safe\yaml_parse',
'yaml_parse_file' => 'Safe\yaml_parse_file',
'yaml_parse_url' => 'Safe\yaml_parse_url',
diff --git a/tests/DateTimeImmutableTest.php b/tests/DateTimeImmutableTest.php
index bfd207d5..21782ee4 100644
--- a/tests/DateTimeImmutableTest.php
+++ b/tests/DateTimeImmutableTest.php
@@ -29,7 +29,7 @@ public function testCreateFromInterface(\DateTimeInterface $dateTime): void
self::assertSame($dateTime->format(\DATE_ATOM), $safeImmutableDate->format(\DATE_ATOM));
}
- public function createFromInterfaces(): array
+ public static function createFromInterfaces(): array
{
return [
[new \DateTime('2022-11-29T14:17:34+00:00')],
diff --git a/tests/JsonDecodeTest.php b/tests/JsonDecodeTest.php
new file mode 100644
index 00000000..661fe178
--- /dev/null
+++ b/tests/JsonDecodeTest.php
@@ -0,0 +1,16 @@
+